Overview
The ZeroGPU connector gives any Sprite you allow access to ZeroGPU’s OpenAI-compatible Chat Completions and Responses APIs, covering both open-weight models and ZeroGPU’s specialized small language models (ZLMs). You save your ZeroGPU API key in Sprites once; agents and scripts in the Sprite then call ZeroGPU through the Sprites gateway without ever seeing the key. By the end of this guide you will have connected your key and run a chat completion, a ZLM classification, and a Responses API call from inside a Sprite.Quickstart
Prerequisites
- A Fly.io organization with Sprites, and a running Sprite to call from.
- A ZeroGPU API key (starts with
zgpu-api-).
Get your ZeroGPU API key
- Sign in to the ZeroGPU dashboard.
- Open API Keys and click Create key.
- Copy the key (it starts with
zgpu-api-). No Project ID is required: every key belongs to one project, and ZeroGPU reads the project from the key.
Connect ZeroGPU in Sprites
- In the Sprites dashboard, open your organization, then Connectors, then Add connection.
- Choose ZeroGPU and paste your API key. Sprites checks the key before saving it (see How key validation works); the check is free.
- Set the connection’s access policy: allow all Sprites, or only those with a given name prefix or labels. A new connection allows no Sprites until you grant access.
- Open the connection and copy its gateway URL. It has the form
https://api.sprites.dev/v1/gateway/zerogpu/<connection_id>.
Your first request
From a shell inside a Sprite that the policy allows, append the ZeroGPU path to the gateway URL. NoAuthorization or x-api-key header is needed; the gateway identifies the Sprite and attaches your key.
chat.completion object. Gateway calls only work from inside a running Sprite; the same request from your laptop or CI is rejected.
Usage
Stream a response
Set"stream": true to receive server-sent events, and pass -N so curl prints each chunk as it arrives:
Classify text with a ZLM
ZLMs are ZeroGPU’s specialized small models.zlm-v1-iab-classify-edge returns IAB content and audience categories with scores, as a JSON string in the message content:
Use the Responses API
What the connector forwards
Everything else is refused at the gateway, including embeddings, moderations, audio, batches, files, and anything that manages API keys, billing, or your account. Requests always run in the project the key belongs to.
Billing
Inference through the connector is charged to your ZeroGPU account at the same prices as direct API calls. Saving, replacing, or testing the key in Sprites is free.How key validation works
Whenever you save, replace, or test your key, Sprites sends one request to confirm it works:200 with the key, project, and organization it belongs to:
The check is free and read-only: it runs no inference, does not touch your balance or free calls, and records no usage. It confirms the key is valid, not that the account has credit, so a valid key on an account with no balance still saves; inference calls then return
402 until you add credit.
Troubleshooting
Sprites rejects the key when you save it. The key is wrong or has been revoked. Copy it again from the dashboard, or create a new one. 403 from the gateway on every call. Either the key was revoked after you saved it (replace it in the connection), or the calling Sprite is not allowed by the connection’s access policy. Check the policy’s name prefix and labels against the Sprite. The request is refused before it reaches ZeroGPU. Either the path is not one the connector forwards (only the three routes above are), or the connection’s endpoint policy blocks it. Check the connection’s allowed and blocked endpoints in Sprites first. For endpoints the connector does not forward, call ZeroGPU from outside the Sprite, so your key stays out of the sandbox. 402 Payment Required. Your ZeroGPU balance is exhausted. Add credit or enable autopay in the dashboard. 404model_not_found. The model ID is wrong. Copy it from the model catalog.
429 responses under load. You are being rate limited. Honor the retry-after header the gateway passes back, and move bulk work to the Batch API by calling ZeroGPU directly.
Calls fail from your laptop or CI. Gateway URLs only accept requests from inside a running Sprite. Outside a Sprite, call https://api.zerogpu.ai directly with your key.
Conclusion
The Sprites connector keeps your ZeroGPU key out of the sandbox while giving the agents in it the full Chat Completions and Responses APIs. Route the high-volume, well-defined steps - classification, extraction, short generation - to ZeroGPU’s small models, and keep the key in one place you control.Model catalog
Every model, its task, context window, and price.
Chat Completions
Full request and response reference.
Sprites connectors
Access policies, gateway URLs, and connection management.
Discord
Ask questions and share what you built.

