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_KEY4Make 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.
400Bad Request
The request body is malformed. Check the JSON shape against the reference.
401Unauthorized
Missing or invalid API key. Make sure the Authorization header uses Bearer <key>.
402Payment Required
Your credit balance is empty. Top up from the pricing page.
404Not Found
The endpoint or model name doesn't exist. See the catalog for valid values.
429Too Many Requests
You've hit your rate limit. Back off and retry with exponential backoff.
500Internal 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.
| Pack | Requests | Concurrent | Max context |
|---|---|---|---|
| Starter | 100 req/min | 5 concurrent | 128K tokens |
| Pro | 600 req/min | 25 concurrent | 128K tokens |
| Scale | 3,000 req/min | 100 concurrent | 200K tokens |
Prefer to experiment first?
The playground simulates streaming responses with zero setup.