EN ▾
Try with trial credit

Does c.AI have an API? What to use instead

Many developers ask does c ai have api access, usually because they want to put a character into their own bot or app. As far as we know, Character.AI does not publish a documented public API; this page explains what that means and how to get the same result with a different service.

Last updated

A glowing chat bubble connected by a cable to a server rack beside an open door, suggesting a self-built chatbot API

Key facts

Our model refuses nothing for lawful adult content, enabling deeper immersion in roleplay scenarios.

You get a standard OpenAI-compatible endpoint with a 100k token context window for long-form narratives.

Billing is transparent and prepaid via crypto, with no monthly subscriptions or hidden fees.

Your prompts are not used for training, ensuring privacy for your creative work.

Uncensored API. No refusals. Pay per token.

The short answer

People type "does c ai have api" into search expecting a yes or a no. The honest answer is that we are not aware of an official, documented, public API for Character.AI that you can sign up for and call with a key. Their product is the app and the website. If that has changed, their own site and help pages are the place to confirm it, and you should trust them over any third-party article, including this one.

This site is not affiliated with Character.AI. We do not offer its characters, its models or its chat history. What we do offer is a hosted text API that follows the OpenAI format, so you can build a character chatbot that you fully control. The rest of this page shows how, and where the trade-offs are.

What about unofficial wrappers?

Searching code hosting sites turns up community libraries that talk to Character.AI by copying what its web client does. They can work for a while. They also share three weaknesses.

  • No contract. The calls are undocumented. A front-end change on their side can break your bot with no warning and no changelog.
  • Terms of service. Automating a consumer product may be against its rules. Read the current terms before you build anything you depend on.
  • No control over the model. You cannot set sampling, choose a context size, or guarantee how the character behaves from one week to the next.

For a hobby script that is your own risk. For anything with users, a documented API with a key, a price per token and defined rate limits is a safer base.

What you get with an OpenAI-compatible API instead

The service on this site exposes POST /v1/chat/completions, POST /v1/responses and GET /v1/models. Any client built for the OpenAI format works after you change two things: the base URL and the key. The model ID is uncensored. It is a single open-weight model run by an independent provider, tuned to answer without content refusals for lawful adult use. It is not Character.AI, and it is not any other vendor's official model.

The important difference from a consumer app is where the character lives. In a hosted API there is no stored persona. You describe the character in a system message and send it with every request, along with the conversation so far. That sounds like extra work, and it is a little, but it also means you own the persona, the memory and the logs.

Text only. There is no image, voice or video generation, so if you want a voiced character you need a separate speech service on your side. Sexual content involving minors is never allowed.

A working character bot in Python

Install the SDK with pip install openai, claim your key on the API key page, and run this. It keeps the history in a list and streams the reply.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.caiapi.cc/v1",
    api_key="YOUR_KEY",
)

PERSONA = (
    "You are Mara, a sarcastic ship's engineer on a long-haul freighter. "
    "Stay in character. Keep replies under 120 words. "
    "Never mention that you are an AI model unless the user asks directly."
)

history = [{"role": "system", "content": PERSONA}]

while True:
    user = input("you: ")
    history.append({"role": "user", "content": user})
    stream = client.chat.completions.create(
        model="uncensored",
        messages=history,
        temperature=0.9,
        stream=True,
    )
    reply = ""
    print("mara: ", end="")
    for chunk in stream:
        if chunk.choices and chunk.choices[0].delta.content:
            piece = chunk.choices[0].delta.content
            reply += piece
            print(piece, end="", flush=True)
    print()
    history.append({"role": "assistant", "content": reply})

Swap the persona text for any character you like. Fiction, companion apps and roleplay for adults are all lawful uses; the model will not make exceptions to the minors rule.

Memory: what the context window does for you

Character apps feel like they remember you because the app resends earlier messages. You do the same. The context window is 100,000 tokens, shared by the prompt and the reply, which is a lot of conversation. A rough guide: a 400-token exchange (one short user message and one reply) means about 250 exchanges fit before you hit the limit.

Long-running characters still need a plan, because cost and focus both suffer when you resend everything forever. Three habits help:

  1. Keep the persona short and put the hard rules first.
  2. When history passes a size you pick, ask the model to summarise the oldest part into a few lines and replace those messages with the summary.
  3. Store stable facts about the user (name, preferences) in your own database and inject them as a line in the system message.

The same request works over curl if you want to test it from a terminal:

curl https://api.caiapi.cc/v1/chat/completions \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"uncensored","messages":[{"role":"system","content":"You are Mara, a sarcastic engineer."},{"role":"user","content":"Status report?"}]}'

What it costs

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, paid from prepaid credit with no subscription. Take a 20-turn chat where the persona is about 300 tokens, each user message is 150 tokens, each reply is 250 tokens, and the full history is resent every turn.

  • Input across 20 turns: 20 x 450 + 400 x (0 + 1 + ... + 19) = 9,000 + 76,000 = 85,000 tokens.
  • Output: 20 x 250 = 5,000 tokens.
  • Cost: 85,000 x $0.15 / 1M = $0.01275, plus 5,000 x $0.50 / 1M = $0.0025, which is about $0.0153 for the whole conversation.

So 1,000 such conversations cost around $15. The pricing page lists top-up sizes and bonuses. Payment is in crypto (USDT on TRC20 or USDC on Base), and failed or refused requests are not charged. New accounts can claim a $0.50 trial credit with one click, valid for 7 days, which covers dozens of test chats.

Limits to plan for

A full key allows 8 concurrent requests and 300 requests per minute; a trial key allows 2 and 60. A streamed reply holds its concurrency slot until the stream ends, so a Discord bot with many active channels should queue requests. When you exceed a limit the API returns HTTP 429 with the code rate_limited or concurrency, and on temporary overload it adds a Retry-After: 5 header. Wait that long and retry once.

You can check your balance with GET /v1/balance or read the X-Balance-USD header on any response. Full request details are in the documentation. Prompts are not used for training. If you want a broader look at uncensored endpoints, our article on uncensored APIs for chat apps covers the background.

Common questions

Is there an official Character.AI API key I can request?

We are not aware of one. Check Character.AI's own site for current information, since we cannot speak for them.

Can I use my existing Character.AI characters with this API?

No. This service has no connection to Character.AI. You recreate a character by writing it as a system prompt.

Does the API remember conversations between requests?

No. Each request is independent, so your code sends the history every time. That gives you full control over what the character remembers.

Will it work with SillyTavern or other chat frontends?

Frontends that accept an OpenAI-compatible endpoint, such as SillyTavern, can use the base URL, your key and the model ID uncensored.

Get your key in one step

Sign up, copy the key, update the base URL. That is all.