A GGUF inference API.
GGUF is the format open models are published in: one file per model, small enough to run on a single machine. You do not need one. Send a request and the answer comes back from a machine that has it.
What you get
Changing two lines points an existing OpenAI client here: the base URL becomes https://api.autarcho.com/v1, and the key becomes an ak_ key you made up. Nothing else in the request changes, there is nothing to install, and there is no plan to buy.
The models are open ones. Each is listed with its price before you send anything, and you are charged for the words you send and the words that come back.
Calling it
Three values: the address, a key, and the model you want.
# the address, the key and the model: that is the whole change
from openai import OpenAI
client = OpenAI(
base_url="https://api.autarcho.com/v1",
api_key="ak_...",
)
stream = client.chat.completions.create(
model="<model id>",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")A key is a string you make up, ak_ followed by 64 characters. Nobody issues it and nothing registers it; the first payment attaches to it. A key with no credit is turned away before any model runs, and that refusal costs nothing.
The same request with the official Python client:
curl -s https://api.autarcho.com/v1/chat/completions \
-H "Authorization: Bearer ak_..." \
-H 'Content-Type: application/json' \
-d '{
"model": "<model id>",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 64
}'What it costs
You pay for the tokens you send and for the tokens the model writes. A long document with a short answer is billed on both sides. Prices are set per model, and the default works out at one dollar per million tokens written, with input at a quarter of that rate.
A request can carry a ceiling, max_price_per_token_micro_usdc. If the model costs more than that, the request is refused before anything is charged, which is the simplest way to bound what an automated loop can spend.
The price in force needs no key: GET /model/<model id>/price?for_client=true.
Finding a model
GET /v1/models lists the models available to your key, each with a price and a file size. Use the model's id rather than a nickname when a request has to mean the same model next month: a nickname is a convenience, and whoever owns it can point it somewhere else.
A model that has left the list answers 404 and will not come back. A model nobody is running right now answers 503, which is worth retrying: it exists, it is just not available this second.
Where it stops
- Text, and one image, one recording or one clip in a request. No other file types.
- A few OpenAI parameters are refused, and the refusal names the parameter, rather than being dropped:
stop,seed,logprobs, and asking for more than one answer at a time. The error names the parameter. - Streaming, tool calls, JSON mode and JSON Schema all work.
- Whoever runs the model can read what you send, as with any hosted API. Nothing is stored afterwards: the machine writes no transcript, and no copy is kept. Treat a prompt as something a stranger could read, and keep credentials out of it.
- A model in the list is not a promise that it is available. Availability follows whoever is running it at that moment.
- The prompt is counted and billed at the input rate, or at a quarter of the output rate when the model sets none. When the count is unavailable, the response says so and the input is not charged.
Questions
Do I need a GPU?
Can I add my own GGUF model?
Is it exactly the OpenAI API?
How much does a request cost?
Can I use the OpenAI client I already have?
https://api.autarcho.com/v1 and use an ak_ key. Chat, streaming, tool calls and JSON output take the same request shape.Which models can I call, and where does the id come from?
GET /v1/models lists them with a price and a file size. Send the id it returns in the model field. An id always means the same model; a nickname does not.What happens if no machine has the model loaded?
503, and it is worth retrying: the model exists, nobody is running it this second. A model that left the list answers 404 and does not come back.Can I cap what one request is allowed to spend?
max_price_per_token_micro_usdc. Above that price the request is refused before anything is charged, so an automated loop cannot run away.