One line to get started.
Autark is a drop-in replacement for the OpenAI API. Point your existing SDK at our base URL, swap your API key, and keep everything else the same. We route each request to the right model behind the scenes.
https://api.autark.ai/v1Authorization: Bearer autark_sk_...Get an API key from cloud.autark.ai. Usage and savings show up in your dashboard.
Quick start
Works with the official OpenAI SDKs. No custom headers, no provider config.
from openai import OpenAI
client = OpenAI(
api_key="autark_sk_YOUR_KEY",
base_url="https://api.autark.ai/v1",
)
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Summarize this contract..."}],
)
print(response.choices[0].message.content)Routing modes
Set the model field to control how Autark handles each request. Use auto unless you have a reason not to.
autoAuto
Autark classifies each request and routes it to the best model for the job. This is what most teams should use.
flashFlash
Fast, cheap inference for simple queries, classification, and high-throughput workloads.
proPro
The default for chat, agents, and everyday workloads. Good balance of quality and cost.
ultraUltra
For hard reasoning, multi-step tasks, and anything where quality matters more than speed.
You can also pin a specific provider model by name if you need to. Autark still handles auth, failover, and billing. See pricing for tier rates.
Streaming
Streaming works the same way as OpenAI. Pass "stream": true and read Server-Sent Events from the response.
stream = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Write a short poem."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True)Response format
Responses follow the standard OpenAI chat completion shape. The model field in the response matches what you sent. Routing details stay on our side.
{
"id": "autark_req_abc123",
"object": "chat.completion",
"model": "auto",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Here is a summary of the contract..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 142,
"completion_tokens": 58,
"total_tokens": 200
}
}Endpoints
/v1/chat/completionsCreate a chat completion. OpenAI-compatible request and response.
/v1/modelsList models available through Autark.
/v1/usageCurrent token usage and estimated savings for your account.
/healthHealth check with provider status.
Data and security
Prompts are processed and discarded. We do not retain request content or use it for training. Compliance metadata (timestamps, model used, token counts) is logged separately from your prompt data.
For the full breakdown, see our trust page.