Skip to content
This is the public test network documentation. Everything here runs on Avalanche Fuji with test USDC.

Use the API

The API follows the OpenAI chat completions shape. Most clients only need a new base URL and a key.

Sign in to the portal at https://app.staging.katara.com, open API keys, and create one. The key is shown once. Keys are bound to your wallet: whatever you approved for spending also covers requests made with the key.

Keys for the public test network start with kat_test_.

Terminal window
curl https://api.staging.katara.com/v1/chat/completions \
-H "Authorization: Bearer $KATARA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "katara/cortex@1",
"messages": [{"role": "user", "content": "Explain a Merkle tree in two sentences."}],
"max_tokens": 200
}'

katara/cortex@1 picks a model for the request and keeps answering when a provider goes away; name a specific model instead when you need exactly that one. The reply carries a katara object with the settled price and the provider that served it:

"katara": { "cost_usdc": "0.000018", "provider": "0xfFe5…38DC" }
from openai import OpenAI
client = OpenAI(base_url="https://api.staging.katara.com/v1", api_key=os.environ["KATARA_API_KEY"])
reply = client.chat.completions.create(
model="katara/cortex@1",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)

Streaming works the same way with stream=True. The final chunk before [DONE] has an empty choices array and carries the katara charge.

Tool calling follows the OpenAI shape too; see Tool calling for what each model is certified for.

GET /v1/models needs no key and returns every model with its capabilities, context window, and the lowest live price. See the API reference for the full shapes and the error codes.