Prompts and scripts over one endpoint
Integrate the Acestep text completion API into your pipeline with this quickstart guide. You will learn how to authenticate, send requests, stream responses, and handle structured outputs using standard OpenAI-compatible libraries.
Prerequisites: SDK Setup
Before making requests, ensure you have an API key. Create an account via email or Google on the Get API key page to receive your token immediately. No credit card is required for the initial setup. You will need a supported programming language environment (Python, Node.js, etc.) and the appropriate SDK installed. The Acestep API follows the OpenAI chat completions specification, so any standard OpenAI-compatible client library works. Configure your client to point to the base URL: https://api.acestep.top/v1. This ensures all requests are routed to the uncensored model correctly without modification.
Authentication with API Key
Authentication is handled via the Authorization header. Pass your API key as a Bearer token. If the key is invalid or expired, the API returns a 401 error. If your prepaid credit is exhausted, you receive a 402 error requiring a top-up. The API key identifies your account and tracks token usage against your prepaid balance. You can generate a new key at any time, which replaces the previous one. Keep your key secure in environment variables rather than hardcoding it in your source files.
Sending Your First Request
Send a standard chat completion request using the /v1/chat/completions endpoint. Specify the model ID as uncensored. The API accepts standard parameters like messages, temperature, and max_tokens. Below is a basic cURL example to test connectivity.
curl https://api.acestep.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
This request sends a simple prompt to the model. Ensure you handle the JSON response, which includes the generated text in choices[0].message.content. The base URL and model ID are the only critical changes from a standard OpenAI call.
Streaming Responses via SSE
For lower latency and real-time user feedback, enable streaming by setting stream: true. The API returns a Server-Sent Events (SSE) stream. Each chunk contains partial content. The final chunk includes the full token usage statistics. This is ideal for chat interfaces or long-form text generation where you want to display output as it is generated.
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell the story in second person."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Parse each SSE event to extract the delta content. Combine these deltas to reconstruct the full response. Be aware that streaming does not reduce the token count; you are still billed for the total input and output tokens used in the request.
Using JSON Mode for Structured Output
When you need consistent data structures, use JSON mode. Set response_format to {"type": "json_object"}. This instructs the model to output valid JSON, reducing parsing errors in your pipeline. This is useful for extracting entities, generating config files, or passing data to other services.
from openai import OpenAI
client = OpenAI(base_url="https://api.acestep.top/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)
Ensure your prompt explicitly describes the expected JSON schema. The model will attempt to conform to the structure, but it is not guaranteed to be perfect. Always validate the output in your code before processing it further.
Function Calling & Tools Support
Support function calling allows the model to invoke external tools. Define your functions in the tools parameter. The model can return a function call instead of text. Set tool_choice to auto or specify a particular function. This enables complex workflows where the API acts as a router or decision engine.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.acestep.top/v1", apiKey: process.env.API_KEY });
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);
Handle the function call response by executing the tool and feeding the result back into the conversation. This supports multi-turn interactions where the model decides when to call a tool and when to provide a final answer.
Understanding Rate Limits & Quotas
The API enforces strict limits to ensure stability. You are limited to 300 requests per minute per key and 8 concurrent requests per key. The maximum request body size is 8 MB. If you exceed the per-minute limit, you receive a 429 error. Implement exponential backoff in your client to handle these retries gracefully. The context window supports up to 100,000 tokens for input and output combined, with no separate output cap. Errors and refusals do not consume tokens, so you can retry failed requests without penalty.
Questions and answers
What happens if I make a mistake with my API key?
If the key is invalid, you receive a 401 error. You can generate a new key from your dashboard, which replaces the old one. The new key becomes active immediately.
Do I get charged for token usage in error responses?
No. Errors such as rate limits (429) or invalid requests do not consume your prepaid credit. You are only charged for successful token generation and input processing.
How do I top up my credit?
Top-ups are made by crypto (USDT on TRC20, USDC on Base). You can top up any whole amount between $20 and $500. Credit never expires, and you receive bonus credits for larger amounts.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
Specs at a glance
Use this table to decide whether the API fits your project before you buy credit.
| Item | Value |
|---|---|
| Protocol | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| API key | Bearer token in the Authorization header |
| Model | uncensored |
| Base URL | https://api.acestep.top/v1 |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Streaming | Supported (stream: true), usage included at the end |
| Completion length | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Context window | 100,000 tokens, input and output combined |
| JSON mode | response_format: {"type": "json_object"} |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Max body | 8 MB request body |
| Concurrency | up to 8 in parallel per key |
| Rate limit | 300 requests per minute per key |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Trial credit | $0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Bonus credit | +5% from $50, +10% from $100, +15% from $200 |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Credit expiry | no monthly fee; paid credit does not expire |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Keys | one active key per account; a new key replaces the old one |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
| Account | sign in with Google or with e-mail + password |
HTTP errors
Every error is JSON with a type you can switch on. You are never charged for an error.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | refused by the content policy |
404 | not_found | unknown endpoint |
413 | request_too_large | request body larger than 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | model busy — retry in a few seconds |