Skip to content

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.

Store your key once per provider:

Terminal window
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 history
echo "$ANTHROPIC_API_KEY" | turion providers set anthropic

Without --key the CLI reads the key from stdin when it is piped, and otherwise prompts without echo. set replaces an existing key.

Terminal window
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
ProviderUpstream
openaihttps://api.openai.com/v1
anthropichttps://api.anthropic.com/v1 (Anthropic’s OpenAI-compatible endpoint)
googlehttps://generativelanguage.googleapis.com/v1beta/openai
openrouterhttps://openrouter.ai/api/v1
groqhttps://api.groq.com/openai/v1
togetherhttps://api.together.xyz/v1
mistralhttps://api.mistral.ai/v1
deepseekhttps://api.deepseek.com/v1
typesafehttps://api.typesafe.ai/v1, for decision models only (turion decide typesafe/jev-1.13), not chat
huggingfacehttps://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.

The gateway reads model and tries these in order:

modelServed 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 callTurion GPUs: your deployed fine-tunes, and self-hosted garden models
<provider>/<model> with a stored key for that providerthe provider directly, with your key
a model-garden idthe model garden
anything else404 model_not_found

Some consequences:

  • Only the first / splits a provider name off: openrouter/deepseek/deepseek-v4.1-flash sends deepseek/deepseek-v4.1-flash to OpenRouter.
  • The provider prefix is case-insensitive: OpenAI/gpt-6.1-sol uses the key stored as openai. The part after the / is sent to the provider as written.
  • openai/gpt-6.1-sol without 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 answers 404 model_not_found with a hint to run turion 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 answers 404 (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}.

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, provider or garden), 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.

Terminal window
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-9a7c4e2b1d03

turion 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.

Optional request headers label a call (each value up to 200 characters) or keep it out of the traces:

HeaderMeaningTurion SDK argument
X-Turion-Agentthe agent making the callagent=
X-Turion-Rungroups the calls of one run or conversationrun=
X-Turion-Stepthe step’s label or number within the runstep=
X-Turion-Trace: offdo not keep a trace of this call (0, false, no and disabled also work)trace=False
import os
from 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 recorded
Terminal window
turion chat acme/support-v3 "…" --no-trace

Then 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.

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 response

Over 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.