EN ▾

Uncensored text API, prepaid by token

OpenAI Compatible API With curl: Quick Start

An OpenAI compatible API curl test is the fastest way to check that a key works before you write any code. Below are copy-paste commands for a plain request, a model list, streaming, JSON mode and a tool call, all against the endpoint on this site.

Updated

Terminal sending a data packet to a server and receiving a stream of tokens, illustrating a curl API test

Key points

  • One POST to /chat/completions with a Bearer key and the model uncensored is enough to test the key.
  • Add -N and stream true to watch tokens arrive over SSE.
  • Use -i to see headers such as X-Balance-USD and the rate limit values.
  • A 429 with code rate_limited or concurrency means you hit a limit, not that the key is bad.

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:

HeaderMeaning
X-Request-IdID to quote if you contact support
X-Balance-USDYour remaining prepaid balance
X-RateLimit-Limit-RequestsRequests per minute allowed for your key
X-RateLimit-Limit-ConcurrencyRequests 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_KEY is not set in the current shell, the header is sent without a key. Run echo "${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) or concurrency (too many at once: 8 on a full key, 2 on a trial key). If the response has Retry-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.

Questions and answers

What is the curl command for an OpenAI compatible API?

POST to the base URL plus /chat/completions with an Authorization Bearer header, a Content-Type of application/json and a body that contains model and messages.

How do I test streaming with curl?

Add "stream": true to the body and use curl -N so the output is not buffered. You will see data lines arrive one after another.

Which model name do I send?

Send uncensored. You can confirm it by calling GET /v1/models with your key.

Does the trial key work with curl?

Yes. A trial key is used the same way as a full key, with lower limits: 2 concurrent requests and 60 requests per minute.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key