AI OS from your own application
Your own applications and scripts can use Labtagon AI OS’s models through an API that speaks OpenAI’s format. Their calls go through the same LLM gateway as the chat: the same models, the same masking of personal data, the same budgets, and each call recorded with its cost.
The address and a key
Section titled “The address and a key”In Studio, find API keys with the sidebar’s search. It shows the Base address,
https://<your-ai-os>/api/llm/v1.
To make a key:
- Say What it is for, for example “Cursor on my laptop”.
- Optional: a Budget a month ($) and when it Ends (never, in 30 days, in 90 days, in a year).
- Create it, then copy it: Your new key: copy it now, it is not shown again.
Try it sends a first request; Revoke ends a key. A key belongs to you, has no scopes and
starts with gbk_. Whether you may make keys at all is your organisation’s decision (a Model
access policy); when it takes that away, existing keys stop working too.
Calling it
Section titled “Calling it”| Endpoint | What |
|---|---|
GET /api/llm/v1/models |
The models and pipelines you may use. |
POST /api/llm/v1/chat/completions |
A chat completion in OpenAI’s format, streamed or not. |
POST /api/llm/v1/messages |
Anthropic’s Messages format, for clients that speak it, such as Claude Code. |
Send the key as Authorization: Bearer gbk_… (or as x-api-key):
curl https://ai.example.com/api/llm/v1/chat/completions \ -H "Authorization: Bearer $AI_OS_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "<a model id from /models>", "messages": [{"role": "user", "content": "Hello"}]}'Any OpenAI client library works with the base address and the key. There is no embeddings endpoint.
Clients that signed in at AI OS can call the API with their AI OS token instead of a key.
Budgets
Section titled “Budgets”- Your key’s budget: what you set on the key, in dollars a month.
- Your organisation’s: a Model access policy can set a budget per person and one for everyone it reaches together. Every budget that applies holds.
A spent budget answers with HTTP 429 (insufficient_quota), for example “This key’s budget for the
month is spent”. Under Insights you see your spend (Your spend in Insights on the keys page).
Your tools without tool code: pipelines (headless MCP)
Section titled “Your tools without tool code: pipelines (headless MCP)”A pipeline is a model of your organisation’s own (<org>/<name>), set up by administrators under
Control Panel → Pipelines: a system prompt, memory, limits, a cache or a guardrail in front of
the models that answer. Its Tools step makes it “headless MCP”:
- You call the pipeline like any model, with your key.
- The gateway offers the model the tools of a profile of yours (The tools of the profile, Default unless set otherwise), runs them as you, goes round until the answer is done, and returns only the final answer.
- The rounds, tool calls and seconds are bounded (Rounds at most 5, Tool calls at most 20, Seconds at most 120 by default).
- A tool call that needs your approval fails the call and says where to approve it.
Your application thus gets your tool servers’ answers through one address and one key, without code of its own for them. The tool servers themselves are reached over MCP only with a sign-in, not with an API key.
What is recorded
Section titled “What is recorded”Each call is recorded with its model, tokens, cost, duration and the key it came with, not the text (unless your organisation keeps prompts of a pipeline). The price is what an administrator set, else what the provider reports, else a list price. See Security and privacy.