Providers & traces
The gateway at POST /v1/chat/completions serves your fine-tunes, and with a stored provider key
it also proxies frontier models such as openai/gpt-6-luna or anthropic/claude-sonnet-5-5. One
base URL and one Turion key cover both, and every call is recorded as a trace. Traces show what
your models and agents were asked and what they answered, and an agent’s traces are the training
data for distillation.
In the workspace: provider keys are under Provider keys at turion.ai/members/keys, and turion.ai/members/traces lists your calls; a trace’s page shows the conversation, the route that served it, latency and tokens.
Provider keys
Section titled “Provider keys”Store your key once per provider:
turion providers set openai# openai API key: ********# stored openai key …abcd# try: turion chat openai/<model> "hello"
# piped, so the key stays out of your shell historyecho "$ANTHROPIC_API_KEY" | turion providers set anthropicWithout --key the CLI reads the key from stdin when it is piped, and otherwise prompts without
echo. set replaces an existing key.
turion providers list# PROVIDER KEY UPDATED BASE URL# openai …abcd 2026-10-08 09:12 https://api.openai.com/v1# anthropic …x9Qa 2026-10-08 09:13 https://api.anthropic.com/v1# google — — https://generativelanguage.googleapis.com/v1beta/openai# …
turion providers rm anthropic| Provider | Upstream |
|---|---|
openai | https://api.openai.com/v1 |
anthropic | https://api.anthropic.com/v1 (Anthropic’s OpenAI-compatible endpoint) |
google | https://generativelanguage.googleapis.com/v1beta/openai |
openrouter | https://openrouter.ai/api/v1 |
groq | https://api.groq.com/openai/v1 |
together | https://api.together.xyz/v1 |
mistral | https://api.mistral.ai/v1 |
deepseek | https://api.deepseek.com/v1 |
typesafe | https://api.typesafe.ai/v1, for decision models only (turion decide typesafe/jev-1.13), not chat |
huggingface | https://huggingface.co, a token for Hugging Face dataset imports and pushes, not model calls |
Keys are encrypted at rest and never returned by any API; listings show the last four characters
(Data & security).
The provider bills you directly for these calls, on your key, and they do not appear in
turion usage. turion providers list --json prints the stored keys and the supported providers
as JSON.
From Python: client.providers.set("openai", key), .list(), .supported(), .remove("openai").
Over REST: PUT /v1/account/providers/{provider} with {"key": "…"}, GET /v1/account/providers,
DELETE /v1/account/providers/{provider}. See
REST API → Provider keys.
How a model name is resolved
Section titled “How a model name is resolved”The gateway reads model and tries these in order:
model | Served by |
|---|---|
agent:<name> | your agent’s route: its fine-tune for the routed share, otherwise its own model; 404 when you have no agent by that name |
<owner>/<name> naming an LLM you can call | Turion GPUs: your deployed fine-tunes, and self-hosted garden models |
<provider>/<model> with a stored key for that provider | the provider directly, with your key |
| a model-garden id | the model garden |
| anything else | 404 model_not_found |
Some consequences:
- Only the first
/splits a provider name off:openrouter/deepseek/deepseek-v4.1-flashsendsdeepseek/deepseek-v4.1-flashto OpenRouter. - The provider prefix is case-insensitive:
OpenAI/gpt-6.1-soluses the key stored asopenai. The part after the/is sent to the provider as written. openai/gpt-6.1-solwithout a stored OpenAI key is not sent anywhere with your key. It falls through to the garden if that is a garden id, and otherwise answers404 model_not_foundwith a hint to runturion providers set openai.- A name that is both a garden id and a
<provider>/<model>you have a key for goes to the provider first. If the provider answers404(it does not know that spelling), the garden serves the call. - Your own fine-tune that exists but is not deployed answers
409 model_not_deployed.
Provider errors come back with the provider’s status for 4xx (a rate limit stays a 429), and
as 502 for the provider’s 5xx. A provider that rejects your stored key is the exception: its
401 or 403 becomes 400 provider_key_invalid, so an OpenAI SDK does not report it as your
Turion key failing. Fix it with turion providers set PROVIDER. The message starts with the provider’s
name, and error.details carries provider and upstream_status. A provider that does not
answer in time is a 504 provider_timeout.
Streaming is passed through. The gateway asks the provider for a final usage chunk so the
trace gets token counts, and passes that chunk on only if you sent
stream_options: {"include_usage": true}.
Traces
Section titled “Traces”Every call through /v1/chat/completions leaves a trace unless you turn it off. A trace holds:
- the request as sent (messages, tools, parameters) and the response (a streamed response is
stored assembled into one
chat.completion), each capped at 256 KB; - the model you asked for, the route that served it (
self_hosted,providerorgarden), the provider and the model that actually answered; - status (
ok,error,cancelled), HTTP status, error code and message; - latency in milliseconds and input/output tokens;
- the agent, run and step it was attributed to.
Every traced response, streamed or not, carries the trace id in an X-Turion-Trace-Id header.
Trace writes happen after the answer is sent and never hold it up; under heavy load a trace can be
dropped rather than slow the call down.
turion traces list --limit 5# ID WHEN MODEL ROUTE STATUS LATENCY TOKENS AGENT RUN# 0192… 2m ago openai/gpt-6-luna provider ok 0.8s 41/9 support r-17# 0192… 5m ago acme/support-v3 self_hosted ok 1.2s 38/52 — —
turion traces get 0192f3a1-6c2e-7b40-8d51-9a7c4e2b1d03turion traces list filters with --agent, --model, --run and --status, newest first,
--limit rows (default 20); --json prints the rows without request and response bodies. On a
narrow terminal the table leaves out ROUTE, RUN and AGENT first, then TOKENS and
LATENCY; piped output keeps every column.
turion traces get ID prints the call as a conversation, tool calls included, with its model,
route, status, latency and tokens; --json prints the stored trace in full.
A request or response over 256 KB is stored as {"_truncated": true, "_bytes": …, "_head": "…"}
and the trace’s truncated flag is set.
Traces are kept with no expiry for now, and there is no self-serve delete: email hello@turion.ai to have them deleted. Retention, deletion and how keys are stored are in Data & security.
Attribute calls
Section titled “Attribute calls”Optional request headers label a call (each value up to 200 characters) or keep it out of the traces:
| Header | Meaning | Turion SDK argument |
|---|---|---|
X-Turion-Agent | the agent making the call | agent= |
X-Turion-Run | groups the calls of one run or conversation | run= |
X-Turion-Step | the step’s label or number within the run | step= |
X-Turion-Trace: off | do not keep a trace of this call (0, false, no and disabled also work) | trace=False |
import osfrom openai import OpenAI
client = OpenAI( base_url="https://api.turion.ai/v1", api_key=os.environ["TURION_API_TOKEN"], default_headers={"X-Turion-Agent": "support"},)client.chat.completions.create( model="openai/gpt-6-luna", messages=[{"role": "user", "content": "Where is order 4417?"}], extra_headers={"X-Turion-Run": "ticket-4417", "X-Turion-Step": "1"},)import turion
client = turion.Client()client.chat.completions.create( "openai/gpt-6-luna", messages, agent="support", run="ticket-4417", step=1)client.chat.completions.create("acme/support-v3", messages, trace=False) # not recordedturion chat acme/support-v3 "…" --no-traceThen turion traces list --agent support --run ticket-4417 shows that run’s calls in order.
turion eval sends its calls with tracing off, so eval prompts never mix with real traffic.
Reading traces from code
Section titled “Reading traces from code”page = client.traces.list(agent="support", status="error", limit=50)for t in page.traces: print(t.id, t.requested_model, t.error_code, t.latency_ms)
for t in client.traces.iter(run="ticket-4417"): # follows next_cursor for you full = client.traces.get(t.id) # includes request and responseOver REST: GET /v1/traces?agent=…&model=…&run=…&status=…&limit=…&cursor=… (newest first,
limit up to 200, next_cursor for the next page) and GET /v1/traces/{id}. See
REST API → Traces.