Move an OpenAI client here.

Three values change: the base URL, the key, and the model id. Everything else works the way it already does, except for four parameters listed below. Each one is an error that names itself rather than a field that disappears.

The three values

If your client already accepts a base URL, this is the whole change. The key is made on your device and is not registered anywhere, and the start page has the three steps to create one and fund it.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.autarcho.com/v1",
    api_key="ak_...",
)

Model ids come from GET /v1/models with that key. They change as operators add and remove models, so read the list rather than pinning an id from a blog post.

What this endpoint refuses

Four things an OpenAI client may send. Each returns a 400 with a param naming the field, so the failure points at the call site instead of producing a subtly different answer.

stop
Remove it. The reply will not stop where you asked, so use max_tokens and cut the text afterwards if the boundary matters.
seed
Remove it. There is no seed to send. temperature: 0 is deterministic for a given model on a given machine, and that is the closest thing here to a fixed sample.
logprobs
Remove it. Token probabilities are not returned.
n above 1
Send separate requests. One request produces one completion.

Tool results

An agent loop works as it does against OpenAI: send tools, take the tool_calls back, then send a tool message carrying the result and its tool_call_id.

The model reads that turn as text, Calling get_weather(...) followed by Tool result (get_weather): .... That is why the loop works on every model here and not only on models trained to read a native tool block. A tool-trained model is guided by text rather than formatted natively, and that is the trade.

A loop with more questions than turns belongs in a list: the same chat requests, submitted together to POST /v1/batches and collected as JSON Lines afterwards. Each item is an ordinary chat request. The request shape is on the use page.

What survives unchanged

Streaming, messages, max_tokens, temperature, top_p, presence_penalty and frequency_penalty all behave as they do elsewhere. tools and tool_choice work for producing a call, the result goes back as a tool message, and response_format works for JSON, including a schema.

Four extensions are also accepted: top_k, min_p, logit_bias, and the DRY repetition settings. The start page lists them with the rest.

Cost and retries

You are billed for generated tokens only. The prompt is not charged, so a long document with a short answer costs what the answer costs.

Add an Idempotency-Key header to any request you might retry. The same key with the same body is charged once, and the same key with a different body is a 409 rather than a silent answer to a different question.

If you want a ceiling per request, send max_price_per_token_micro_usdc. A model priced above it is refused before any credit is reserved.