Models
Call open-weight language models through an OpenAI-compatible endpoint, with a project API key, from your own code or from the coding agents you already use.
Base URL
https://app.sailops.io/api/ai/v1
Three endpoints are served:
| Endpoint | Purpose |
|---|---|
POST /chat/completions | Chat completions, streaming or not, with tool calling on the models that support it |
POST /responses | The Responses API, streaming or not, which Codex speaks by default |
GET /models | The models your key can use |
The request and response bodies are the OpenAI formats. Anything else under /api/ai/ — the Anthropic Messages API, embeddings, GET or DELETE /responses/{id} — answers 404.
Authentication
Create a project API key holding the ai-models:invoke scope, from AI → Models → Create key in the console, or from Project settings → API keys by ticking the scope. The key is shown once.
Send it as a bearer, which is what every OpenAI SDK does, or as X-Api-Key:
curl https://app.sailops.io/api/ai/v1/chat/completions \
-H "Authorization: Bearer $SAILOPS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Say hello in French."}]
}'
Organization keys and personal keys are refused with 403: a request is always served inside the project its key names, and usage is billed to that project.
A deleted, rotated or edited key takes effect within a second or two. If the notice between SailOps servers is lost, the change applies at most 30 seconds later.
Use SailOps Models in one click
An agent sandbox does not need a key pasted by hand. On its card in the console, Use SailOps Models creates a project key labelled models-<name>, holding ai-models:invoke only, and writes OPENAI_API_KEY and OPENAI_BASE_URL into the sandbox's secret environment, so Codex, OpenCode and Pi inside it use Models on their next start.
Running the action again rotates the key: a new one is written, the previous models-<name> key is revoked. The key never leaves the workload; the project's key list shows its prefix, and the usage view counts its tokens under its label. The action is refused during the trial.
Models and prices
Prices are in euros per million tokens, excluding tax. Cached input tokens are the part of the prompt the provider served from its cache; they are billed at the cached price when the model has one, at the input price otherwise. Reasoning tokens are part of the output.
| Model id | Providers | Context | Tools | Responses | Input | Cached input | Output |
|---|---|---|---|---|---|---|---|
glm-5.3 | Scaleway | 256k | yes | yes | 2.25 € | — | 6.90 € |
deepseek-v4.1-flash | Scaleway | 256k | yes | yes | 0.75 € | 0.15 € | 2.25 € |
qwen3.8-27b | Scaleway, OVHcloud | 256k | yes | yes | 0.75 € | — | 4.15 € |
qwen3.5-397b | Scaleway | 250k | yes | yes | 0.75 € | — | 4.50 € |
gpt-oss-120b | Scaleway, OVHcloud | 128k | Responses only | yes | 0.20 € | — | 0.75 € |
mistral-medium-3.5 | Scaleway | 180k | yes | yes | 1.90 € | — | 9.40 € |
GET /models and the public API answer the same list with the prices your organization is billed at, so a negotiated price shows there rather than here. gpt-oss-120b only supports tool calling through the Responses API.
Providers and failover
Every model is served from France: Scaleway Generative APIs in Paris, OVHcloud AI Endpoints in Gravelines. A model listed with two providers goes to the cheapest one for SailOps; if that provider answers 429, a 5xx, times out or cannot be reached before the first byte of the answer, the request is sent once more to the other provider. Once the first byte has been sent, nothing is retried or switched: a stream that breaks mid-way breaks for you too.
The price does not depend on the provider. The receipt of each request records which provider served it, so the usage view and the CSV can show it, but the amount billed is the model's.
Limits
| Limit | Value | Answer when reached |
|---|---|---|
| Requests per minute, per key | 60 | 429 with Retry-After |
| Tokens per minute, per key | 300 000 | 429 with Retry-After |
| Monthly budget, per project | 50 € by default, adjustable | 402 with insufficient_quota |
| Request body | 2 MiB | 413 |
| Time to first byte | 30 s | 504, after the failover |
| Stream duration | 10 min | the stream is cut; what was produced is billed |
Authenticated model listings and relay attempts count toward the request limit, including attempts rejected before a provider call. Rate-limited requests do not read pricing or budget stores.
Every response carries x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-limit-tokens and x-ratelimit-remaining-tokens. Tokens are debited once the answer is known, so a burst can overdraw the minute and pay it back on the next refills.
The monthly budget is set per project under AI → Models, along with an optional allow-list of models, or through the public API (PUT /api/v1/ai/models/settings, scope ai-models:update). A change reaches the endpoint within a minute. Usage is counted from every request's receipt, so the budget stops requests within a minute of being reached. A budget of zero refuses every request. Set the budget before handing a key to an agent that runs unattended.
Errors use the OpenAI envelope, so SDKs raise their usual exceptions:
{"error": {"message": "Monthly budget of 50.00 EUR reached for this project (50.12 EUR spent this month). A project maintainer can raise it in the console.", "type": "insufficient_quota", "param": null, "code": "budget_exceeded"}}
Streaming
Streaming works as with OpenAI: send "stream": true and read the server-sent events. SailOps always receives the token usage from the provider; on chat completions the final usage-only chunk is forwarded to you only when you ask for it with "stream_options": {"include_usage": true}, so clients that index choices[0] keep working. On the Responses API the usage arrives in the response.completed event, as with OpenAI.
If your client disconnects mid-stream, SailOps keeps reading the provider's answer so the tokens it produced are recorded — and billed — rather than lost.
Responses API
POST /responses takes the OpenAI Responses format — input, instructions, tools, stream — and relays it to the provider. The usage is read from the usage object of the answer, or from the response.completed event of a stream: input_tokens, output_tokens, input_tokens_details.cached_tokens and output_tokens_details.reasoning_tokens are billed exactly as their chat completions counterparts.
Codex’s optional include: ["reasoning.encrypted_content"] extension is omitted upstream: the stateless providers do not produce encrypted reasoning. Other request fields are forwarded.
Responses are not stored: previous_response_id is not supported, and GET or DELETE /responses/{id} answer 404 with the code responses_not_stored. Send the previous output back as input to continue a conversation, which is what Codex does. Built-in tools (web search, file search) are not available; function calling is.
curl https://app.sailops.io/api/ai/v1/responses \
-H "Authorization: Bearer $SAILOPS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-oss-120b", "input": "Say hello in French.", "stream": true}'
What is logged
Models keeps metadata only: the project and key, the model, the provider that served the request, the token counts, the latency, the status, and whether the client disconnected. Prompts and completions are never stored by SailOps; the Scaleway Generative APIs are served from Paris with zero data retention, and OVHcloud AI Endpoints from Gravelines. Every request receipt feeds the project's usage view and the monthly invoice line AI Models.
Usage
AI → Models shows the month's requests, tokens and amount per model and per API key, read from the receipts, so it includes today. The same figures are available through the public API (GET /api/v1/ai/models/usage, scope ai-models:get) and the MCP tools ai_models_list and ai_usage_get. The monthly invoice carries one AI Models line per project, with the token lines detailed in the usage CSV.
Configure your tools
OpenAI SDKs
from openai import OpenAI
client = OpenAI(base_url="https://app.sailops.io/api/ai/v1", api_key=os.environ["SAILOPS_API_KEY"])
completion = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Say hello in French."}],
)
print(completion.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://app.sailops.io/api/ai/v1", apiKey: process.env.SAILOPS_API_KEY });
const response = await client.responses.create({
model: "gpt-oss-120b",
input: "Say hello in French.",
});
console.log(response.output_text);
Codex
Codex speaks the Responses API by default; point it at Models in ~/.codex/config.toml:
model = "gpt-oss-120b"
model_provider = "sailops"
[model_providers.sailops]
name = "SailOps Models"
base_url = "https://app.sailops.io/api/ai/v1"
env_key = "SAILOPS_API_KEY"
wire_api = "responses"
wire_api = "chat" works too, on every model; gpt-oss-120b calls tools only on the Responses wire. In an agent sandbox pointed at Models with the one-click action, OPENAI_API_KEY and OPENAI_BASE_URL are already set: env_key = "OPENAI_API_KEY" and the same base_url do.
OpenCode
Add a provider to ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"sailops": {
"npm": "@ai-sdk/openai-compatible",
"name": "SailOps Models",
"options": {
"baseURL": "https://app.sailops.io/api/ai/v1",
"apiKey": "{env:SAILOPS_API_KEY}"
},
"models": {
"glm-5.3": { "name": "GLM 5.3" },
"deepseek-v4.1-flash": { "name": "DeepSeek V4.1 Flash" },
"qwen3.5-397b": { "name": "Qwen 3.5 397B" }
}
}
}
}
Claude Code
Claude Code speaks the Anthropic Messages API, which Models does not relay: use your own Anthropic key with Claude Code, and SailOps Models with the OpenAI-compatible tools above. Agent sandboxes carry both keys as container secrets.
Availability
Models is not available during the trial: a key of a trial organization is refused with 403, and the one-click action is refused in the console. On an installation where Models is not enabled, the endpoint answers 404; keys can still be created and written into workloads.