ULK Cloud

Character AI API | API Key, Pricing, and Alternatives for Your Own App

As of 2026-11-28 we found no official public Character.AI API, API key, or API pricing; GitHub libraries are unofficial and use your personal account token. To run your own character chatbot, use an OpenAI-compatible API with the character card as the system prompt: on ULK Cloud a 5,000-input, 400-output message costs $0.000438 on deepseek-v4.1-flash, $0.00068 on glm-5.3-flash, and $0.00252 on glm-5.3.

As of 2026-11-28, we found no official public Character.AI API: no developer portal, no API key program, and no published API pricing. The "Character AI API" projects on GitHub are unofficial wrappers that log in with your own Character.AI account token. If you want to run your own character chatbot inside your own app, the usual route is an OpenAI-compatible LLM API: you write the character card as a system prompt, send the conversation history with each request, and pay per token. On ULK Cloud, a chat message with 5,000 input tokens and 400 output tokens costs $0.000438 on deepseek-v4.1-flash, $0.00068 on glm-5.3-flash, and $0.00252 on glm-5.3.

ULK Cloud is our own API, so keep that in mind when you read the comparison. Character.AI is a consumer product, and this article does not judge it as one; it only answers what a developer can call from code.

Is there an official Character AI API key?

No official Character.AI API key program was publicly available when we checked on 2026-11-28. We looked for a developer portal, API documentation, and an API pricing page, and found none. The Character.AI creator documentation (book.character.ai) explains how to write characters on the Character.AI site, not how to call it from code. The maintainers of the most-used unofficial library say the same thing in their README: "CharacterAI has no official api and all breakpoints were found manually using reverse proxy."

Character.AI could publish an API later. If you read this long after 2026-11-28, check Character.AI's own site before you plan around the answer above.

Unofficial Character AI Python APIs on GitHub

The libraries that come up for character ai python api and character ai api github describe themselves as unofficial. We read their READMEs on 2026-11-28:

LibraryWhat its README says
PyCharacterAI"An asynchronous Python api wrapper for Character AI". "This is an unofficial library made by an enthusiast who has no relation to the CharacterAI development team." It tells you to copy the token from the Authorization header in your browser's developer tools.
kramcat/CharacterAI"Unofficial Python API for character.ai". "The library was developed without the participation of Character AI developers or their knowledge." It is marked as an alpha version and needs an account.

Three consequences follow for anyone building an app on them:

  • The token is a personal account token. These libraries act as your logged-in Character.AI account. A token is not an API key issued for an app, and it cannot be given to your app's users.
  • They can stop working without notice. The endpoints were found by watching the website's traffic, so a change to the website can break them.
  • Read Character.AI's terms first. Before you automate an account, read Character.AI's terms of service yourself and decide whether your use fits them.

For a personal script that talks to characters you already use on Character.AI, an unofficial library may be enough. For a public app with its own users, you need an API that issues keys for that purpose.

Build your own character chatbot with an OpenAI-compatible API

An OpenAI-compatible API runs a character chatbot with three parts: the character card in the system message, the past turns as user and assistant messages, and the new message from the user. The model keeps no memory between requests, so your app stores the history and sends it every time.

This Python example uses the official OpenAI SDK against ULK Cloud. We ran it on 2026-11-28 with openai 3.60.0 for Python.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["ULK_API_KEY"],
    base_url="https://api.ulkcloud.com/v1",
)

# The character card goes in the system message
CHARACTER = """You are Mira, a cheerful librarian in a seaside town.
Speak in short, warm sentences. Stay in character."""

MAX_HISTORY = 20  # past messages sent with each request


def reply(history: list[dict], user_message: str) -> str:
    history.append({"role": "user", "content": user_message})
    response = client.chat.completions.create(
        model="glm-5.3-flash",
        messages=[{"role": "system", "content": CHARACTER}, *history[-MAX_HISTORY:]],
        max_tokens=600,
        temperature=0.8,
    )
    text = response.choices[0].message.content
    history.append({"role": "assistant", "content": text})
    print(response.usage.prompt_tokens, response.usage.completion_tokens)
    return text


history = []
print(reply(history, "Hi Mira, any book for a rainy day?"))
print(reply(history, "Which one would you pick for me?"))

In our run, the first call used 46 input tokens and the second 134, because the second call also carried the first exchange. That growth is what drives the cost of a character chat app, and MAX_HISTORY is the simplest way to cap it.

To get started:

  1. Sign up at https://console.ulkcloud.com. New accounts get $0.50 of credit.
  2. Open API keys in the console and create a key. It starts with sk-ulk-.
  3. Put the key in an environment variable on your server (ULK_API_KEY in the examples) and run the code.

Model IDs and prices are on the models page. The other values you can send are listed in Use the OpenAI SDK with ULK Cloud.

Stream character replies from your server

Character chat apps usually show the reply as it is written. With stream: true, ULK Cloud sends the reply in chunks; with stream_options.include_usage, the last chunk carries the token counts. This Node.js function uses the openai package (4.104.0 in our test on 2026-11-28) and runs on your server:

import OpenAI from "openai";

// Runs on your server. The browser or mobile app never sees this key
const client = new OpenAI({
  apiKey: process.env.ULK_API_KEY,
  baseURL: "https://api.ulkcloud.com/v1",
});

export async function streamReply(character, history, onText) {
  const stream = await client.chat.completions.create({
    model: "deepseek-v4.1-flash",
    messages: [{ role: "system", content: character }, ...history.slice(-20)],
    max_tokens: 600,
    stream: true,
    stream_options: { include_usage: true },
  });
  for await (const chunk of stream) {
    const text = chunk.choices[0]?.delta?.content;
    if (text) onText(text);
    if (chunk.usage) console.log(chunk.usage.prompt_tokens, chunk.usage.completion_tokens);
  }
}

Pass each piece of text from onText to your client over your own connection (server-sent events or a WebSocket). If the user closes the chat in the middle of a reply and your server stops reading the stream, ULK Cloud bills only the part that was sent.

What a character chat app costs on ULK Cloud

A character chat message costs (input tokens × input price) + (output tokens × output price). The input is the character card plus the history plus the new message; the output is the reply plus any thinking tokens, which ULK Cloud bills as output. In our 2026-11-28 tests, glm-5.3 thought for 218 tokens before a short greeting, deepseek-v4.1-flash for 64 to 68 tokens, and glm-5.3-flash for 7. The example below assumes 400 output tokens per message, thinking included.

Example message: a 1,000-token character card, 4,000 tokens of history, and the new message, about 5,000 input tokens in total.

ModelPrice (1M in / out)One message (5,000 in / 400 out)1,000 messages
deepseek-v4.1-flash$0.07 / $0.22$0.000438$0.44
glm-5.3-flash$0.12 / $0.20$0.00068$0.68
glm-5.3$0.40 / $1.30$0.00252$2.52

The math for glm-5.3: 5,000 × $0.40 / 1,000,000 = $0.002 for input, 400 × $1.30 / 1,000,000 = $0.00052 for output, $0.00252 in total.

For a monthly figure, take an app with 300 daily active users who send 40 messages each: 12,000 messages a day, 360,000 in a 30-day month.

ModelMonth (360,000 messages, 5,000 in)Month if history grows to 20,000 in
deepseek-v4.1-flash$157.68$535.68
glm-5.3-flash$244.80$892.80
glm-5.3$907.20$3,067.20

The right column shows why history length matters more than reply length. When long chats send 20,000 input tokens per message instead of 5,000, the monthly cost is three to four times higher. Capping the history, or replacing old turns with a short summary, keeps the cost close to the left column. ULK Cloud charges all input at one rate, with no discount for repeated input.

Limits to plan for when you run a character chat app on ULK Cloud

ULK Cloud's limits below were checked in its code on 2026-11-28.

  • 1,000 requests per minute per API key. Above that, the API returns 429 rate_limit_exceeded. Retry after a short wait. The example app above averages about 8 requests a minute.
  • Set max_tokens. Before a request runs, ULK Cloud holds the most it could cost from your balance and settles the real cost when it ends. Without max_tokens, the output limit is 32,768 tokens, so each glm-5.3 request holds about $0.0426 for output alone (32,768 × $1.30 / 1M); with max_tokens: 600 it holds $0.00078. Many users chatting at once with no limit can hold most of a small balance, and new requests are then refused. Do not set it too low: thinking counts toward max_tokens, and a reply can come back empty if the limit runs out while the model is thinking.
  • Prepaid balance. Requests are paid from a balance topped up by card, $5 to $1,000 per top-up. When the balance cannot cover a request, the API returns 402 insufficient_balance, and your users see no reply. Watch the balance in the console. Each key can also have a monthly spending limit (402 monthly_limit_reached).
  • Keep the API key on your server. The /v1 API accepts calls from any browser origin, which is useful for personal tools, but a key placed in a public web page or a mobile app can be copied by anyone who uses it. ULK Cloud's terms also prohibit "Lending, transferring, or selling API keys to a third party" (section 6, checked 2026-11-28). Your users talk to your server, and your server calls ULK Cloud.
  • Secrets in messages are stopped. If a user pastes something that looks like an API key or a private key into the chat, the request is rejected with 400 secret_detected and is not charged. Show the user a message asking them to remove it.

ULK Cloud's terms require account holders to be 18 or older. If your app offers adult-oriented characters, age checks for your own users are your responsibility.

Character AI vs unofficial libraries vs your own API

Which option fits depends on what you are building.

OptionFitsDoes not fit
Character.AI appChatting with Character.AI's characters and communityCalling from your own code: no official API found as of 2026-11-28
Unofficial libraryA personal script on your own accountA public app: personal token, can break, check Character.AI's terms
OpenAI-compatible APIYour own app with your own characters and usersReusing Character.AI's characters, memory, or voice features

ULK Cloud is one OpenAI-compatible option. It does not fit if you need a monthly flat price, image input, or models other than the DeepSeek V4.1 Flash and GLM-5.3 families. If characters in your app are refused too often, glm-5.3-uncensored ($0.35 / $1.10) refuses less, but it adds an instruction prompt of about 5,300 input tokens to every request, billed as input: the example message then costs about $0.0040 instead of $0.00252 on glm-5.3. No model answers every request. Prices for all models are on the pricing page.

FAQ

Is there a free Character AI API?

No official Character.AI API, free or paid, was publicly available as of 2026-11-28. Unofficial libraries are free to install but use your personal account token. To try a character chatbot API for free, ULK Cloud's $0.50 sign-up credit covers about 1,140 messages on deepseek-v4.1-flash at 5,000 input and 400 output tokens each.

What is Character AI API pricing?

Character.AI has published no API pricing as of 2026-11-28, because it has no public API. With an OpenAI-compatible API you pay per token instead; on ULK Cloud, a 5,000-input, 400-output character message costs $0.000438 to $0.00252 depending on the model.

Is there a Character AI SDK?

No official Character.AI SDK was found as of 2026-11-28. To build your own character chatbot, the official OpenAI SDK for Python or JavaScript works with any OpenAI-compatible API by changing the API key, the base URL (https://api.ulkcloud.com/v1 for ULK Cloud), and the model ID.

Can I use my Character AI token in my own app?

The token that unofficial libraries ask for is your personal Character.AI login. It is not an API key for an app, and anyone with it can act as your account. Do not share it with users or put it in an app; read Character.AI's terms before automating your account.

How do I give an API character a personality?

Write the character card in the system message: name, setting, way of speaking, and what the character should not do. Send it with every request, ahead of the conversation history, because the model remembers nothing between requests.