Documentation

Quickstart

From zero to your first API call in about two minutes.

1Get an API key

Create an account, buy any credit pack, and generate a key from the dashboard. Keys look like nvsk-… and are shown only once — store yours somewhere safe.

2Authenticate

Pass your key as a Bearer token on every request. All traffic goes to the base URL https://api.nariwal.shop/v1.

export NARIWAL_API_KEY="nvsk-your-key-here"

curl https://api.nariwal.shop/v1/chat/completions \
  -H "Authorization: Bearer $NARIWAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "nariwal-1", "messages": [{"role": "user", "content": "Hello!"}]}'

3Install an SDK

Official SDKs handle auth, retries, and streaming for you.

pip install nariwal

# then:
from nariwal import Nariwal
client = Nariwal()  # reads NARIWAL_API_KEY

4Make your first call

curl https://api.nariwal.shop/v1/chat/completions \
  -H "Authorization: Bearer $NARIWAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nariwal-1",
    "messages": [{"role": "user", "content": "Give me 3 tagline ideas for a coffee brand."}],
    "temperature": 0.8
  }'

Error codes

Errors follow standard HTTP semantics. The response body always includes error.code and a human-readable message.

400

Bad Request

The request body is malformed. Check the JSON shape against the reference.

401

Unauthorized

Missing or invalid API key. Make sure the Authorization header uses Bearer <key>.

402

Payment Required

Your credit balance is empty. Top up from the pricing page.

404

Not Found

The endpoint or model name doesn't exist. See the catalog for valid values.

429

Too Many Requests

You've hit your rate limit. Back off and retry with exponential backoff.

500

Internal Error

Something failed on our side. Retry once; if it persists, contact support with the x-request-id header.

Rate limits

Limits are per API key and reset every 60 seconds. Responses include x-ratelimit-remaining headers.

PackRequestsConcurrentMax context
Starter100 req/min5 concurrent128K tokens
Pro600 req/min25 concurrent128K tokens
Scale3,000 req/min100 concurrent200K tokens

Prefer to experiment first?

The playground simulates streaming responses with zero setup.

Open playground