API reference
API reference
This page lists only the endpoints we have actually tested on amuletapi.com. If a path isn't on this page, don't assume it works. All amounts are in US dollars. If you've never used an API before, start with New to APIs? Start here.
Quick start: four ways to call
Pick the one you use, copy it, replace "your key" with a key you created in the console, and run it.
1. Base URL
The root address is https://amuletapi.com. Each protocol needs a different ending; get it wrong and you'll see a 404 or no connection.
| Where | Enter |
|---|---|
| OpenAI-compatible SDKs, Chat Completions, Responses, Codex | https://amuletapi.com/v1 |
| Claude Code / Anthropic Messages | https://amuletapi.com (don't add /v1; the path already includes it) |
| Gemini native API | https://amuletapi.com, with request paths starting at /v1beta/... |
Use the full path, like /v1/models or /v1/messages. Just /models or /messages won't work.
2. Authentication
Create an API key in the console; it starts with sk-. Examples on this page always write it as sk-your-key. Replace it with your own and never post it online.
| Protocol | How to send the key |
|---|---|
| OpenAI-compatible | Header Authorization: Bearer sk-your-key |
| Anthropic Messages | Prefer Authorization: Bearer sk-your-key. You can also use x-api-key: sk-your-key; we've tested both. Also send anthropic-version: 2023-06-01. |
| Gemini native | Use Authorization: Bearer sk-your-key, or x-goog-api-key, or add ?key=sk-your-key to the URL. All three are tested. |
3. Live endpoints
Streaming is tested too; just turn on stream the way each protocol expects.
| Endpoint | What it does |
|---|---|
GET /v1/models | Lists the models your key can use, in OpenAI format. |
GET /v1beta/models | Lists models in Gemini format. |
GET /v1beta/openai/models | Under the Gemini path, but still returns an OpenAI-format model list. |
POST /v1/chat/completions | The most common chat endpoint, compatible with OpenAI Chat Completions. Supports stream: true. |
POST /v1/responses | OpenAI Responses; Codex uses this one. Supports streaming. |
POST /v1/messages | Anthropic Messages; Claude Code uses this one. Supports streaming. |
POST /v1beta/models/{model}:generateContent | Gemini native generation. |
POST /v1beta/models/{model}:streamGenerateContent | Gemini native streaming generation. |
GET /v1/videos/models | Lists the video models on sale, their resolutions and prices. No key needed. |
POST /v1/videos | Submits a video job. Needs a key; charged at the listed price. |
GET /v1/videos/{task_id} | Checks a job's status. |
GET /v1/videos/{task_id}/content | Downloads the finished video file. |
Model names must match the IDs on the pricing page exactly, like claude-haiku-5-5, gpt-5.6-luna or gemini-3.8-flash. Charges are in US dollars, and input and output can have different prices.
4. List models
Fetch the list once, then use the returned id in your requests. This one returns OpenAI format:
curl https://amuletapi.com/v1/models \ -H "Authorization: Bearer sk-your-key"
curl https://amuletapi.com/v1/models -H "Authorization: Bearer sk-your-key"
If you send x-api-key and anthropic-version together, the same GET /v1/models returns an Anthropic-style list. For Gemini format, use GET /v1beta/models.
5. Chat Completions
Good for most chat apps, the Python SDK and your own scripts. Claude, GPT, Gemini and Grok all work here as long as the model ID is right.
curl https://amuletapi.com/v1/chat/completions \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-luna","messages":[{"role":"user","content":"Hello"}],"max_tokens":64}'curl https://amuletapi.com/v1/chat/completions -H "Authorization: Bearer sk-your-key" -H "Content-Type: application/json" -d "{\"model\":\"gpt-5.6-luna\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"max_tokens\":64}"For typewriter-style output, add "stream": true to the request body. The response is then text/event-stream, one data: event per line, ending with [DONE].
6. Responses
This is OpenAI's newer API; Codex's official wire_api = "responses" setting uses it. Set the Base URL to /v1 and don't add any ending other than /responses by hand.
curl https://amuletapi.com/v1/responses \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-luna","input":"Hello","max_output_tokens":64}'curl https://amuletapi.com/v1/responses -H "Authorization: Bearer sk-your-key" -H "Content-Type: application/json" -d "{\"model\":\"gpt-5.6-luna\",\"input\":\"Hello\",\"max_output_tokens\":64}"For streaming, add "stream": true here too. Step-by-step Codex setup is in Guide · Codex.
7. Anthropic Messages
Claude Code and tools that use the Anthropic protocol go through this one. Note that the Base URL is the site root; the client requests /v1/messages itself.
curl https://amuletapi.com/v1/messages \
-H "Authorization: Bearer sk-your-key" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"claude-haiku-5-5","max_tokens":64,"messages":[{"role":"user","content":"Hello"}]}'curl https://amuletapi.com/v1/messages -H "Authorization: Bearer sk-your-key" -H "anthropic-version: 2023-06-01" -H "Content-Type: application/json" -d "{\"model\":\"claude-haiku-5-5\",\"max_tokens\":64,\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}"If you get a 401, replace Authorization with x-api-key: sk-your-key and try again. For streaming, add "stream": true. Full Claude Code steps are in Guide · Claude Code.
8. Gemini native API
If your tool calls Google Gemini paths, write it like this. Replace the model name in the path with a Gemini ID from the pricing page, like gemini-3.8-flash.
curl https://amuletapi.com/v1beta/models/gemini-3.8-flash:generateContent \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"contents":[{"parts":[{"text":"Hello"}]}]}'curl https://amuletapi.com/v1beta/models/gemini-3.8-flash:generateContent -H "Authorization: Bearer sk-your-key" -H "Content-Type: application/json" -d "{\"contents\":[{\"parts\":[{\"text\":\"Hello\"}]}]}"For streaming, change the end of the path to :streamGenerateContent and leave everything else the same. The response is text/event-stream.
9. Video generation
Video uses /v1/videos, a different path from chat. Your existing site key works. Submit a job to get a task ID, poll its status, then download the file when it's done. Please don't submit the same request twice. Model IDs, resolutions and prices are as shown on the pricing page and by GET /v1/videos/models.
Seedance 2.5 is charged per video, in 15-second and 30-second tiers, with different prices for text-to-video and image-to-video; see Video on the pricing page. Seedance 2.0 is still per video, whatever the length. See the pricing page for how Grok Imagine Video is charged. If your balance is too low the job is refused, so you never owe anything. Send the request body as JSON.
curl https://amuletapi.com/v1/videos/models
curl https://amuletapi.com/v1/videos/models
curl https://amuletapi.com/v1/videos \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-2.0","prompt":"A lighthouse by the sea at dawn, waves lapping the rocks","resolution":"720p","ratio":"16:9","duration_seconds":5}'curl https://amuletapi.com/v1/videos -H "Authorization: Bearer sk-your-key" -H "Content-Type: application/json" -d "{\"model\":\"seedance-2.0\",\"prompt\":\"A lighthouse by the sea at dawn, waves lapping the rocks\",\"resolution\":\"720p\",\"ratio\":\"16:9\",\"duration_seconds\":5}"curl https://amuletapi.com/v1/videos/TASK_ID \ -H "Authorization: Bearer sk-your-key"
curl https://amuletapi.com/v1/videos/TASK_ID -H "Authorization: Bearer sk-your-key"
curl -L https://amuletapi.com/v1/videos/TASK_ID/content \ -H "Authorization: Bearer sk-your-key" -o clip.mp4
You can send seconds instead of duration_seconds, and aspect_ratio instead of ratio. For image-to-video, put reference images in the images array (image_base64 and image_url also work). If you don't send mode to Seedance, no image means text-to-video (text_to_video) and an image means image-to-video (image_to_video); you can also set mode yourself. A job can take a few minutes, so poll it rather than submitting again.
Billing
Balances, prices and usage are shown in US dollars. You pay in RMB when you top up, and the credit is converted at the rate on the top-up page at the time, currently ¥7 = $1. Go by what the page shows.
Text models are charged for the tokens actually used; input and output can have different prices. Video: Seedance 2.5 is per video, in 15-second and 30-second tiers; Seedance 2.0 is per video whatever the length; for Grok Imagine Video see Video on the pricing page. If your balance is too low the request is refused, so you never owe anything. To reconcile, check the request log in the console.
Timeouts and streaming
For long non-streaming jobs, switch to stream=true. Streaming only cuts off after 5 minutes with no new output; it isn't a 5-minute cap on the total time.
504s caused by the gateway buffering large requests in full have been fixed. If a model takes more than about 100 seconds before sending its first token, Cloudflare may still return a 504.
With a long context (tens of thousands of tokens), your client has to upload the whole conversation before the model can start, and on a slow connection the upload alone can take tens of seconds. Set your client's timeout to about 10 minutes: Claude Code already defaults to 10 minutes (API_TIMEOUT_MS, in milliseconds; don't lower it), and the official OpenAI and Anthropic SDKs default to 10 minutes too; in other apps look for a Timeout setting. If uploads always break at the same point, the limit is usually on the client or network side; starting a new conversation or letting the tool compact its context also helps.
Large requests first reserve an amount based on the input size, then settle to actual usage when they finish. If your balance is below the reservation the request is refused with an error that says so; top up and send it again.
If the endpoint is wrong (a missing or extra /v1, or a Bedrock or Azure format), you get an error explaining the right setting instead of a web page. Common missing or extra /v1 mistakes are fixed automatically.