Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cogito.decart.ai/llms.txt

Use this file to discover all available pages before exploring further.

1. Get an API key

Sign in at cogito.decart.ai, then create a key from Dashboard → API keys. Copy it once — we never show the full secret again.
export COGITO_API_KEY="cog-live-..."

2. Send a request

Cogito is OpenAI-compatible. Use the OpenAI SDK in any language; just point base_url at https://api.cogito.decart.ai/v1.
curl https://api.cogito.decart.ai/v1/chat/completions \
  -H "Authorization: Bearer $COGITO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-oss-120b",
    "messages": [
      { "role": "user", "content": "Why is the sky blue?" }
    ]
  }'

3. Stream tokens

Add stream: true to receive an SSE stream of OpenAI-compatible chunks.
stream = client.chat.completions.create(
    model="gpt-oss-120b",
    messages=[{"role": "user", "content": "Why is the sky blue?"}],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Next