The minimal request
Set your key once as a variable so you do not paste it into every command. You can create a key, and claim the free trial credit, on the API key page.
export API_KEY='paste-your-key-here'
Then send a chat completion. The base URL is https://api.acestep.top/v1, auth is a Bearer header, and the model ID is uncensored.
curl https://api.acestep.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [
{"role": "system", "content": "You write short scripts for video prompts."},
{"role": "user", "content": "Write a two-sentence prompt for a rainy neon street scene."}
],
"temperature": 0.7,
"max_tokens": 150
}'
The reply is JSON. The text sits at choices[0].message.content, and token counts are under usage. max_tokens is optional; leave it out and the completion can use the rest of the 100,000-token window.
Read only the answer
The raw JSON is long. If you have jq installed, pipe the output through it:
curl -s https://api.acestep.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "uncensored", "messages": [{"role": "user", "content": "Name three moods for a synth track."}]}' \
| jq -r '.choices[0].message.content'
Use -s to hide the progress meter. To see how many tokens you used, swap the filter for .usage.
List models and check headers
GET /v1/models is a cheap way to test a key because it generates nothing:
curl -i https://api.acestep.top/v1/models -H "Authorization: Bearer $API_KEY"
The -i flag prints response headers. Look for these:
| Header | Meaning |
|---|---|
X-Request-Id | ID to quote if you contact support |
X-Balance-USD | Your remaining prepaid balance |
X-RateLimit-Limit-Requests | Requests per minute allowed for your key |
X-RateLimit-Limit-Concurrency | Requests allowed at the same time |
The list should include uncensored. If the call fails, the problem is the key or the URL, not the model.
Stream the response
Add "stream": true and tell curl not to buffer with -N. Tokens arrive as server-sent events, one data: line per chunk, ending with data: [DONE].
curl -N https://api.acestep.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "uncensored", "stream": true, "messages": [{"role": "user", "content": "Tell a six-sentence story about a lighthouse keeper."}]}'
Each chunk carries a small delta with the next piece of text. Usage is sent at the end of the stream. One practical note: a streamed request occupies its concurrency slot until the stream ends. Ctrl+C closes the connection and frees the slot, but a script that never reads the stream to the end keeps it busy.
JSON mode and a tool call
For machine-readable output, set response_format and ask for JSON in the prompt:
curl -s https://api.acestep.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"response_format": {"type": "json_object"},
"messages": [{"role": "user", "content": "Return JSON with keys genre and bpm for a chill lofi track."}]
}'
To test tool calling, describe one function. The model answers with a tool_calls entry instead of text, and you send the result back as a message with role: "tool".
curl -s https://api.acestep.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "What is the weather in Lisbon?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}
}],
"tool_choice": "auto"
}'
Look for choices[0].message.tool_calls with the function name and its arguments as a JSON string. Details and more parameters are in the docs.
When the command fails
- Nothing happens or "could not resolve host". Check the URL spelling. The path must be
/v1/chat/completions. - A JSON parse error on the server side. Quoting. On Linux and macOS use single quotes around the body. In Windows cmd, use double quotes and escape the inner ones, or put the body in a file and send it with
-d @body.json. - Empty variable. If
$API_KEYis not set in the current shell, the header is sent without a key. Runecho "${API_KEY:0:4}"to check that it has a value. - HTTP 429. The body contains the code
rate_limited(requests per minute: 300 on a full key, 60 on a trial key) orconcurrency(too many at once: 8 on a full key, 2 on a trial key). If the response hasRetry-After: 5, the service is briefly overloaded; wait five seconds and repeat. - Body too large. The maximum request body is 8 MB.
A reusable test script
If you check the API often, for example after a deploy or when a teammate reports a problem, put the test in a small script that prints the HTTP status and the answer. The -w option makes curl print the status code after the transfer.
set -euo pipefail
: "${API_KEY:?Set API_KEY first}"
BASE="https://api.acestep.top/v1"
status=$(curl -s -o /tmp/reply.json -w "%{http_code}" "$BASE/chat/completions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "uncensored", "messages": [{"role": "user", "content": "Reply with the word ready."}], "max_tokens": 10}')
echo "HTTP $status"
jq -r '.choices[0].message.content // .error' /tmp/reply.json
A status of 200 with the word "ready" means the key, the route and the model are all fine. Anything else, read the body: it is saved in /tmp/reply.json. For longer prompts, put the JSON in a file and use -d @body.json, which avoids shell quoting problems with apostrophes and quotation marks in the text.
Two more curl options are handy. --retry 3 repeats the call on some transient failures, and --max-time 60 stops a request that hangs. Do not use retries blindly in loops over many prompts, because repeated 429 responses mean you should slow down, not push harder.
From curl to your code
Everything above maps one to one to the OpenAI SDKs: set the base URL and key, use the model uncensored, and the same JSON fields apply. This model is text only; it does not generate images, audio or video, so use it for the prompt and script step of a pipeline.
Pricing is pay as you go from prepaid credit: $0.15 per 1M input tokens and $0.50 per 1M output tokens, with no subscription. Failed or refused requests are not charged. A request with 800 input tokens and 200 output tokens costs $0.00012 for input plus $0.0001 for output, $0.00022 in total. Top-ups and bonuses are on the pricing page.
