Developers

Quickstart

Scrip is OpenAI-compatible. Set the base URL and your key — the rest is the API you already use.

Authentication

Pass your sk-scrip- key as a bearer token. Keys are created in the dashboard, shown once, and revocable at any time.

curl
curl https://api.scrip.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-scrip-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta-llama/Llama-3.3-70B",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

With the OpenAI SDK

Point the official client at Scrip. No other changes.

python
from openai import OpenAI

client = OpenAI(base_url="https://api.scrip.ai/v1", api_key="sk-scrip-...")

resp = client.chat.completions.create(
    model="meta-llama/Llama-3.3-70B",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

Streaming

Set stream: true for server-sent events. We meter from the terminal usage chunk — your prompt and the response are never written down.

python
stream = client.chat.completions.create(
    model="meta-llama/Llama-3.3-70B",
    messages=[{"role": "user", "content": "Count to five"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Balances & errors

When your balance runs low you get a warning before zero. A call made with an empty balance returns an OpenAI-shaped 402 with a top-up link; nothing is billed for a failed generation.

  • 401 — missing or revoked key.
  • 402 — insufficient balance; includes a top_up_url.
  • 400 — model not available on this key’s tier (e.g. a retaining model on a no-log key).