AGI
API docs

OpenAI-compatible endpoints.

curl https://agiworkforce.com/api/llm/v1/chat/completions \  -H "Authorization: Bearer $AGI_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "model": "auto", "messages": [{ "role": "user", "content": "hello" }] }'
Quick start

Two credentials, and only one of them is refused anywhere.

A session bearer token, the same one the apps hold, is accepted on every operation. An AGI API key (sk_live_…, issued in the developer console) carries the scopes you pick when you create it and reaches everything except embeddings: models:read for the catalog, inference:write for chat completions, audio transcriptions and route preview, usage:read for the credit balance. Every operation in the bundle names the credential and the scope it accepts. API key access is included with Pro, Max 5x, Max 20x, Team, and Enterprise; on any other plan the gateway refuses the key with managed_api_plan_required.

  • Stream tokens back with stream: true
  • model: "auto" routes per request; name a model to pin it
  • BYOK on CLI and VS Code never touches this gateway
Authorization: Bearer <session token> GET  /api/llm/v1/modelsPOST /api/llm/v1/chat/completionsPOST /api/llm/v1/embeddingsPOST /api/llm/v1/audio/transcriptionsPOST /api/llm/v1/route/previewGET  /api/llm/v1/credits/balance
A session bearer token, the same one the apps hold. Every operation accepts it.

SDKs.

There is no AGI SDK. The gateway speaks the OpenAI chat format, so OpenAI's official libraries are the client: install openai from pip or npm, set OPENAI_BASE_URL to https://agiworkforce.com/api/llm/v1 and OPENAI_API_KEY to an AGI API key, or pass the same two values to the client. Through the library you list models, create chat completions, buffered or streamed, and transcribe audio. Embeddings take a session token, not a key. An Idempotency-Key header, sent through extra_headers in Python or the request options' headers in TypeScript, makes a retry count once and lets you look up what the request cost; without one the gateway assigns its own to each call.

# pip install openai# export OPENAI_BASE_URL=https://agiworkforce.com/api/llm/v1# export OPENAI_API_KEY=sk_live_...import uuidfrom openai import OpenAI client = OpenAI() for model in client.models.list():    print(model.id) stream = client.chat.completions.create(    model="auto",    messages=[{"role": "user", "content": "Summarise the attached notes"}],    stream=True,    extra_headers={"Idempotency-Key": str(uuid.uuid4())},)for chunk in stream:    if chunk.choices:        print(chunk.choices[0].delta.content or "", end="") with open("meeting.m4a", "rb") as audio:    transcript = client.audio.transcriptions.create(file=audio, model="auto")print(transcript.text)
The client reads OPENAI_BASE_URL and OPENAI_API_KEY when base_url and api_key are not passed.

Plain HTTP for the rest

Route preview, the credit balance, cost estimates and settled costs are AGI endpoints that the OpenAI libraries have no method for. Call them with any HTTP client, with the same key in the Authorization header.

curl https://agiworkforce.com/api/llm/v1/route/preview \  -H "Authorization: Bearer $AGI_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "selection": "auto", "taskType": "general" }'
The route auto would take for a task, without running it. Needs inference:write.

Webhooks.

Register an HTTPS endpoint in the developer console and choose its events. Each event is a POST with a JSON body carrying object, id, type, created_at in Unix seconds and data. Requests follow Standard Webhooks: webhook-id is the event id, webhook-timestamp the send time in Unix seconds, and webhook-signature is v1, followed by the base64 HMAC-SHA256 of the id, the timestamp and the raw body joined with full stops, keyed with the part of your whsec_ secret after the prefix. Answer with a 2xx within 10 seconds. Any other answer, a redirect or silence is retried with exponential backoff for about 3 days, and the console's delivery log shows each attempt and resends any delivery. Send test event delivers webhook.test.

  • api_key.createdA key was created in the developer console or in settings.
  • api_key.revokedA key was deleted, or revoked because its project was archived.
  • project.spend_limit_reachedA project used its monthly credit limit, so its keys are refused until the month ends.
  • task_run.completedA scheduled or started task finished its run.
  • task_run.failedA task run failed or reached its time limit.
  • task_run.needs_approvalA task run paused until someone approves its next step.
{  "object": "event",  "id": "4f2b1c9e-6a3d-4c8e-9b1f-2d7e5a0c3b18",  "type": "api_key.revoked",  "created_at": 1790553600,  "data": {    "id": "b7a0e2d4-1f3c-4e5a-8b6d-9c0f1e2a3b4c",    "name": "Production",    "project_id": null,    "reason": "deleted"  }}
webhook-id carries the event id, which stays the same when a delivery is retried or resent.

Moving to the gateway.

Three moves cover most code: from the OpenAI API, from the Anthropic API, and from one model to another once you are here.

From the OpenAI API

Point the client at https://agiworkforce.com/api/llm/v1 and pass an AGI API key with the inference:write scope. An Idempotency-Key header is optional with a key; reuse one only to retry the same body. Replace model names with an id from GET /models, or send auto to have each request routed. The model receives messages, temperature, max_tokens or max_completion_tokens, and tools with tool_choice; response_format with json_object or json_schema is enforced when stream is false. top_p, n, stop, seed, the penalties, logit_bias and user are accepted but not passed to the model. The gateway serves chat completions, models, audio transcriptions, embeddings (session token only), route preview and the credit balance; there is no Responses, Assistants, Batch, Files, Images or fine-tuning endpoint.

From the Anthropic API

Requests use the OpenAI chat format rather than Messages. Put the system prompt first in messages with the role system. A tool becomes { "type": "function", "function": { name, description, parameters } }, with your input_schema as parameters. A tool_use block comes back as an entry in the assistant message's tool_calls, its input a JSON string in function.arguments, and you answer it with a message whose role is tool and whose tool_call_id names the call. stream: true sends chat.completion.chunk events ending in [DONE] instead of message events. Stop sequences are not applied.

Between models

A request that names a model keeps it until you change the id; auto picks per request under your plan and workspace policy. POST /route/preview shows the route auto would take for a task without running it, so you can compare before switching. When a model you pin is scheduled to leave, its deprecation_date in GET /models tells you when to move.

Deprecations.

A model that is leaving is announced before it goes. Every model in GET /models carries a deprecation_date, null until a retirement is scheduled; the Models page in the app marks it Retiring with that date, and as the date nears the model picker says Leaving. From that date the model is no longer listed.

  • Veo 3.1 veo-3.1October 22, 2026
  • Veo 3.1 Fast veo-3.1-fastOctober 22, 2026
  • Veo 3.1 Lite veo-3.1-liteOctober 22, 2026
  • GPT-4o Mini TTS gpt-4o-mini-ttsJanuary 6, 2027
  • GPT-4o Mini Transcribe gpt-4o-mini-transcribeFebruary 26, 2027
  • GPT-4o Transcribe gpt-4o-transcribeFebruary 26, 2027

Reference.

The OpenAPI 3 bundle is published. It describes every endpoint that ships and the credential each one takes. There is no Postman collection and no AGI SDK: use OpenAI's libraries for models, chat and transcription, and plain HTTP for the rest.