F5 TTS: Prompts and scripts over one endpoint
F5 TTS provides an OpenAI-compatible text API designed for generating uncensored scripts, prompts, and captions for voice pipelines. This quickstart guides you through authentication, basic requests, and streaming with the /v1/chat/completions endpoint.
Base URL & Authentication
Use https://api.f5tts.top/v1 as your base URL. The API accepts any OpenAI-compatible SDK or HTTP client by setting the base_url and providing your API key in the Authorization header.
Sign up via Google or email to receive a single active API key per account. If you generate a new key, the previous one becomes invalid immediately. There is no phone number requirement, and your email is the only personal data needed.
curl https://api.f5tts.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."}]
}'The uncensored model does not refuse adult, niche, or controversial topics, except for a hard limit on sexual content involving minors. This makes it ideal for voice scripts where generic filters might block creative or mature content.
Generate Text with /v1/chat/completions
Send a POST request to /v1/chat/completions with the model ID uncensored. The API expects a standard messages array containing your prompt or conversation history.
Each request supports a context window of 100,000 tokens total (input + output). If you do not specify max_tokens, the output can run to the end of the window. Otherwise, you can set it up to the remaining context limit.
from openai import OpenAI
client = OpenAI(base_url="https://api.f5tts.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)This endpoint handles text generation for scripts, captions, and post-processing. It does not generate audio, images, or embeddings. Use this text output as the input for your TTS engine.
List Available Models
Query GET /v1/models to verify connectivity and list available models. You will see the uncensored model ID listed here. This endpoint helps you confirm that your API key is valid and the service is reachable before sending larger payloads.
The response format matches the standard OpenAI models endpoint. Use this to debug connectivity issues or verify the base URL configuration in your SDK.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.f5tts.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);This is a read-only endpoint that returns metadata about the model, including its ID and object type.
Streaming Responses (SSE)
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) as tokens are generated. This is useful for real-time display or incremental processing in your pipeline.
The final chunk of the stream includes the token usage statistics for the request. This allows you to track input and output token counts in real-time for billing or monitoring purposes.
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)Handle the stream events to accumulate the full text response. Ensure your client library supports SSE parsing for smooth integration.
JSON Mode & Function Calling
Use response_format: {"type": "json_object"} to force the model to output valid JSON. This is essential for structured data extraction or generating config files for voice pipelines.
Function calling (tools) is also supported. Define tools in your request, and the model will return structured tool calls when appropriate. Use tool_choice to control whether the model calls a tool or generates text.
These features allow you to integrate the text API directly into complex workflows, such as extracting entities from scripts or generating structured prompts for other AI systems.
Rate Limits & Costs
Requests are limited to 300 per minute and 8 concurrent requests per key. The request body must be under 8 MB. Errors and refusals do not consume credits, so you only pay for successful token generation.
Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Top-up is by crypto (USDT on TRC20, USDC on Base) with a 5-15% bonus for larger amounts. Credit never expires.
If you exceed the rate limit, you will receive a 429 error. Ensure your client handles retries with exponential backoff to avoid throttling.
Questions and answers
What happens if I send an invalid API key?
The API returns an authentication error indicating the key is invalid. Ensure your key is active and correctly formatted in the Authorization header. Generate a new key if the old one was revoked.
Does the API block adult content?
No, the uncensored model allows adult, niche, and controversial topics. The only hard limit is sexual content involving minors, which is always refused. This makes it suitable for mature voice scripts.
How do I top up my credit?
Use crypto (USDT TRC20 or USDC Base) via the top-up page. Amounts range from $20 to $500, with bonuses for higher tiers. Credit never expires, and errors are free.
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
A quick checklist for developers: format, limits, features, billing.
| Spec | Value |
|---|---|
| API format | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Base URL | https://api.f5tts.top/v1 |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Authentication | Authorization: Bearer YOUR_KEY |
| Model | uncensored |
| Context window | 100,000 tokens, input and output combined |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Completion length | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| SSE streaming | Supported (stream: true), usage included at the end |
| Structured output | JSON object mode via response_format json_object |
| Concurrency | 8 requests at the same time per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Max body | 8 MB request body |
| Rate limit | 300/min per key |
| 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 |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Top-up | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Credit expiry | paid credit never expires, no subscription |
| How you pay | prepaid credit, charged by real token usage; errors and refusals are free |
| Token prices | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Content | adult content allowed; sexual content involving minors is refused |
| Keys | one active key per account; a new key replaces the old one |
| Account | sign in with Google or with e-mail + password |
When a request fails
The type field is stable, the message is for humans. Errors cost nothing.
| Status | Type | Reason |
|---|---|---|
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 | sexual content involving minors — refused, not billed |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | temporary overload, retry shortly |