Developer API
The Digitorn API lets your own software use the agents you build in the Studio: put them in your site with your users already signed in, talk to them from your server, manage your users and their plans.
https://api.digitorn.ai/v1
Every call runs through the same rules as the Digitorn app: your plans and limits, your billing, and the isolation between your users all apply, with nothing to rebuild on your side.
Keys
| Key | Where it comes from | What it can do |
|---|---|---|
sk_… secret key | Studio → your agent → Project → Access | Everything about your project: its agents, its users, their conversations and plans. Server only. |
pk_… publishable key | same place | Used by your published app in the browser. Not accepted by the API. |
Access to your own Digitorn space (your agents and conversations, for scripts and AI tools you use yourself) is coming with account keys and the Digitorn MCP server.
Send the key in the Authorization header:
curl https://api.digitorn.ai/v1/me \
-H "Authorization: Bearer sk_..."
{ "kind": "project", "project": { "id": "6828…", "name": "My shop", "mode": "test" } }
sk_ on your serverA request carrying a secret key and an Origin header (a browser) is refused
with server_only. Never put sk_ in a web page, a mobile app or a repository.
Acting for one of your users
Add the Digitorn-User header with your own id for that user (from your
database: user_482, an e-mail, a UUID…). The call then runs as that user, with
exactly their rights: their conversations, their plan, their connected accounts.
curl https://api.digitorn.ai/v1/conversations \
-H "Authorization: Bearer sk_..." \
-H "Digitorn-User: user_482"
- The user is created the first time a write names them; a read never
creates anyone (it answers
user_not_found). - Ids are 1 to 128 characters among letters, digits and
. _ : @ + -. - The same id is the same person everywhere: on every device, in your site and through the API.
Errors
Every error has the same shape and says whether to retry:
{
"error": {
"code": "quota_reached",
"message": "you reached your limit; it resets later",
"retryable": true,
"retry_after_seconds": 50361,
"trace_id": "tr_d14536a9511aec79e09e"
}
}
| HTTP | Meaning |
|---|---|
| 401 | Missing, invalid or revoked key |
| 403 | Not allowed for this key (server_only, user_disabled, project_key_required…) |
| 404 | Unknown agent, conversation, user or plan (also what you get for something that is not yours) |
| 409 | Conflict (user_conflict, agent_ambiguous, idempotency_key_in_use) |
| 422 | Invalid request; fields lists what is wrong. Unknown fields are refused. |
| 429 | Too many requests, or the user's plan / the project's ceiling is reached (quota). Retry-After is set. |
| 503 | Unavailable for a moment; retry. |
Tracing, retries and limits
X-Trace-Id: send your own (up to 64 charactersA-Z a-z 0-9 . _ : -) or get one back on every answer. Quote it when you contact us.Idempotency-Keyon anyPOST,PUTorDELETE: retrying with the same key returns the first answer (Idempotent-Replayed: true) instead of acting twice. The same key with a different request is refused (idempotency_key_reused). Keys are kept 24 hours.- Rate limit per key, announced in
RateLimit-LimitandRateLimit-Remaining; over it you get429withRetry-After. - Bodies are JSON, at most 1 MB. Dates are ISO 8601 in UTC.
Next
- Put your agent in your site — with your users already signed in.
- Conversations — talk to an agent from your server.
- Users and plans — your users, their plans and limits.