FAQ & Troubleshooting
Most issues come down to a wrong base URL, an expired key, or a model that doesn't exist on our gateway. Skim this page first — the fix is usually a 30-second change.
Troubleshooting
My key returns 401 "unauthorized"
Almost always one of three things:
- Wrong header name. Claude / Anthropic requests need
x-api-key, while Codex/OpenAI-compatible and Gemini requests needAuthorization: Bearer .... Check what your client sends. - Key not yet active. After payment, the key is generated in the webhook — usually within 5 seconds. If it's been longer, refresh the dashboard.
- Wrong key in env. Run
echo $YOUR_KEY_VAR | head -c 8and confirm it starts withcr_. If it doesn't, your client is still using an old key.
Claude Code opens but doesn't see my key
Claude Code reads ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL from environment or ~/.claude.json. After you export the vars, restart your shell — Claude Code caches config at startup.
Requests work but credits drop way faster than expected
Check two things:
- You may be on a non-cached path. Enable prompt caching and the same workload typically costs 60–80% less.
- Check
max_tokenson your request. Setting it to 4096 when you only need 200 makes the output 20× more expensive.
I paid but no key showed up in my dashboard
Webhook delivery can take 5–30 seconds. Refresh the dashboard. If after 5 minutes there's still nothing:
- Check the email used at checkout — the key is sent there too.
- Check spam / promotions folders; sender is
noreply@sparkapi.cc. - Email support@sparkapi.cc with your payment confirmation number.
"model_not_found" but the model exists on Anthropic's site
We don't proxy every model — only the 12 listed in the Models page plus the full *-codex family. If it's not in the catalog, it won't resolve. Pick a similar model from the list and update the model field.
Streaming stops mid-response
This is usually a client-side timeout, not us. Bump the request timeout to at least 120 seconds. If you still see it on short replies, email support with the request ID from x-request-id in the response headers.
FAQ
Do credits expire?
No. Credits stay on your account until you spend them. Buy $15 today, use $0.50 a month — works fine.
Can I get a refund?
Yes, within 7 days of purchase, as long as you've used less than 10% of the credits. See the refund policy for details.
Is my data used to train models?
No. SparkAPI is a stateless proxy — requests go to the upstream provider, responses come back, nothing is logged beyond billing counters.
Can I share my key across team members?
You can, but the credit balance is shared too — there's no per-user accounting. For team plans, contact support.
Do you support function calling / tool use / vision?
Yes. Anything the upstream model supports, we pass through. Send the same tools, tool_choice, images arrays you'd send to Anthropic / OpenAI / Gemini directly.
How do I switch from the official API to SparkAPI?
Change two things: the base URL and the API key. The request body, headers, and response format stay identical. See the Quickstart for a copy-paste example.
Can I use SparkAPI in a commercial product?
Yes. The terms of service allow commercial use. You're responsible for the output of the model in your product, same as if you were calling the upstream API directly.
What happens if SparkAPI goes down?
Requests fail fast with a 5xx and a clear error. Your client should treat it like any other transient API failure: retry with backoff. The dashboard status indicator shows live availability.