Base URLs
The engine owns the conversation loop, so anything that runs an agent talks to
api.usegradient.dev. Everything else (invoking a deployed tool, driving the builder over MCP, reading management resources) talks to the console.
Conventions
- Authentication is an
Authorization: Bearerheader carrying an organization API key. See Authentication. - Responses are JSON. Console endpoints wrap results as
{ "ok": true, ... }and errors as{ "ok": false, "error": "..." }. Engine endpoints return the agent payload directly, and{ "error": "..." }on failure. - Request bodies are JSON, with one exception: the engine
invokeroute takes the user message astext/plain. - Errors use standard HTTP status codes:
401unauthenticated,403missing scope,400bad request,404not found,402when billing blocks the request.
Test your key
A quick unauthenticated-to-authenticated check is the consolewhoami route, which needs no scope:
Endpoints
Authentication
API keys, the Bearer header, and scopes.
Invoke a published agent
One request in, the agent’s reply out.
Turn (low-level)
Carry your own transcript across a conversation.
Invoke a custom tool
Call a deployed handler and get its JSON back.
Hosted MCP
Drive your whole organization from an MCP client.