Interfaces
REST API
Everything the MCP tools do is available over HTTP, authenticated by API key.
Full endpoint reference
Every endpoint, request and response schema, and a try-it console, generated from the OpenAPI spec, so it never drifts from the API.
Base URL
Every endpoint lives under https://api.server4agent.com. Paths in the reference are written relative to it.
Authentication
Send your sk_live_ API key as a bearer token on every request. Keys are server-side secrets; never ship one in a browser bundle. Provisioning takes no body and no plan field; limits derive from the account behind the key.
curl -X POST https://api.server4agent.com/servers \
-H "Authorization: Bearer $SERVER4AGENT_API_KEY"
# → { "id": "srv_2k9", "url": null, "status": "running", "tier": "small" }Mint and scope keys from Authentication or the dashboard.
Errors
Every failure returns a JSON body { "error", "message" } with a machine-readable code:
400bad_request: The request was malformed.401missing_or_invalid_api_key: Missing or invalid API key.402budget_exceeded: Authorized, but the account is out of budget.403plan_limit: A plan limit was hit (e.g. a tier's project cap).404not_found: No such resource.502compute_backend_error: The compute backend returned an error.
Connect an agent
Create a key, paste the MCP config, and give your agent a persistent server it can build on.