Skip to Content
NineTwo's
Cookbook

cURL basics

Minimal cURL examples for models and chat completions.

List models

curl -sS "$NINETWOS_BASE_URL/models" \
  -H "Authorization: Bearer $NINETWOS_API_KEY"

Chat completion with idempotency key

curl -sS "$NINETWOS_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $NINETWOS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: cookbook-curl-001" \
  -d '{
    "model": "zuv-0.5",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_completion_tokens": 256,
    "stream": false
  }'

max_completion_tokens is canonical; max_tokens is a compatibility alias. The same key and canonical payload replay the stored result. Reusing the key with a different payload returns 409 idempotency_conflict and does not dispatch.

On this page