Loading models…
Loading models…
op-inference/sakana/fugu-ultra-v22 providers serve this model, cheapest first. We route each request to one of them. Our price is the provider's rate plus our 4.5% fee. Prices are per 1M tokens.
| Provider | Our price | Provider's price | Context | Max output | Your data |
|---|---|---|---|---|---|
| Cheaper Inference | $3.39625 in · $20.3775 out | $3.25 in · $19.50 out | 1,000,000 | 1,000,000 | May train on inputs |
| OpenRouter | $10.45 in · $47.025 out | $10.00 in · $45.00 out | 1,000,000 | 128,000 | No training |
Every request carries a key as a bearer token. Create a key, then put it in your environment.
export OP_API_KEY="<your key>"Nothing to install: curl ships with your shell, and fetch is built into Node 18 and later.
POST /v1/chat/completions is OpenAI-compatible: any OpenAI SDK works once its base URL points here.
curl https://api.opinference.com/v1/chat/completions \
-H "Authorization: Bearer $OP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "op-inference/sakana/fugu-ultra-v2",
"messages": [
{
"role": "user",
"content": "Say hello."
}
]
}'The example waits for the whole reply. Send "stream": true to receive it as server-sent chat.completion.chunk events instead, ending with data: [DONE]. Usage arrives on the last chunk.
One chat.completion, in the OpenAI shape.
{
"id": "gen_01J9K2…",
"object": "chat.completion",
"model": "sakana/fugu-ultra-v2",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello!"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 3,
"total_tokens": 12
}
}The request body for POST /v1/chat/completions. A key not listed here is refused, and the error names it.
modelstringrequiredThe id of this model.
messagesarrayrequiredThe conversation so far, in the OpenAI chat format. A user message may include image_url parts.
streambooleantrue streams server-sent events; false returns one chat.completion.
max_completion_tokensintegerThe most tokens the model may generate.
max_tokensintegerOlder name for max_completion_tokens.
temperaturenumberSampling randomness. Lower is more deterministic.
toolsarrayFunctions the model may call, in the OpenAI tools format.
response_formatobjectConstrains the reply to JSON.
modelsstring[]Other model ids to try, in order, if this one is unavailable. Up to 5.
providerobjectWhere and how the request may run: region, zdr for zero data retention, data_collection, sort, and max_price, the most you will pay.
opobjectOptions for this request: retention, which can only be stricter than your key allows, tags, and session_id to group requests.
A chat completion, in the OpenAI shape.
idThe generation id.
objectAlways "chat.completion". With stream: true, each event is a "chat.completion.chunk".
modelThe public id of the model that answered.
choices[].messageThe reply: role, content and any tool_calls. A chunk carries delta instead.
choices[].finish_reasonstop, length, tool_calls or content_filter.
usageprompt_tokens, completion_tokens, total_tokens, and cached and reasoning token details. On the last chunk when streaming.