Open an agent session
Changed onCreates a short-lived session for the Cardog agent. Its token is a signed grant that says who the agent acts as, which tools it may use and which account pays for each turn. Pass token as the grant query parameter when you open the agent's socket. It expires after 120 seconds, so create a new one for every connection.
The kind of session follows the credential you send: a signed-in session opens a personal session, an API key opens one billed to that key, an anonymous session opens an anonymous one, and an organization token from an organization workspace opens an organization session. An organization API key, or a server with no person behind it, is a 403.
Costs 0 credits. Each agent turn is billed; the data the agent reads during a turn is not.
Request
- Base URLhttps://api.cardog.app
- Auth
- API key in header x-api-key
- or HTTP bearer
Request body
Where the session is opened from: "web" (the Cardog website), "org" (an organization workspace), "native" (the mobile app), "mcp" (an MCP server) or "sdk" (your own program, using an API key). Default "sdk".
Session settings. hidden lists tools to hide, up to 64.
The org token from the organization workspace, a short-lived credential tied to your membership. Send it to open an organization session; leave it out for a personal one.
Response
The session and its token
The signed session. Send it as the grant query parameter when you open the agent socket, or in the X-Cardog-Agent-Grant header when you read threads. It expires after 120 seconds: create a new session on every connect.
What the session may do and who pays, as signed into token
Where the session is opened from: "web" (the Cardog website), "org" (an organization workspace), "native" (the mobile app), "mcp" (an MCP server) or "sdk" (your own program, using an API key). Default "sdk".
The session settings
When the session expires, ISO 8601
The path of the agent socket. Open it with ?grant={token} on the same host as this API.
self: this endpoint. threads: the session's past chats, when it has any.
Changes
- info
endpoint added
- info