Docs

One API for the OpenAI and Anthropic SDKs. Point yours at Alian and keep the rest of your code.

Base URL
https://api.alian.com/v1

Quick start

1

Create a key

Sign in and create an alk- key in the dashboard.

2

Set the base URL

https://api.alian.com/v1 for the OpenAI SDK, https://api.alian.com for the Anthropic SDK.

3

Send a request

Name a model from the list. Set stream to true to stream.

curl https://api.alian.com/v1/chat/completions \
  -H "Authorization: Bearer alk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3-flash-abliterated",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'
Your key and the base URL

Authentication

Send your key with every request, as a bearer token or in x-api-key. Keys start with alk-.

OpenAI SDK base URLAny OpenAI-compatible client.
https://api.alian.com/v1
Anthropic SDK base URLThe SDK adds /v1/messages itself.
https://api.alian.com
Bearer headerWhat OpenAI-compatible clients send.
Authorization: Bearer alk-…
x-api-key headerWhat the Anthropic SDK sends.
x-api-key: alk-…

Endpoints

Three paths on api.alian.com. The OpenAI SDK reaches them from its base URL; the Anthropic SDK adds /v1/messages itself.

POST
/v1/chat/completionsChat, in the OpenAI format.
POST
/v1/messagesMessages, in the Anthropic format.
GET
/v1/modelsThe models your key can call.
In the Anthropic format
from anthropic import Anthropic

client = Anthropic(
    api_key="alk-your-key",
    base_url="https://api.alian.com",
)

message = client.messages.create(
    model="glm-5.3-flash-abliterated",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)

print(message.content[0].text)

Models

Open models on our partner's GPUs, with zero data retention. Pass the ID as model.

GET /v1/models with your key lists the IDs it can call. Prices are on the pricing section.

Streaming

Set stream to true and the reply arrives as server-sent events, in the endpoint's own format: chat completion chunks from /v1/chat/completions, Messages events from /v1/messages. Both SDKs read them for you, as in the quick start.

For token counts on a chat completions stream, send "stream_options": {"include_usage": true}. The stream then ends with one usage chunk, its choices empty, right before [DONE]: the same counts the request is billed with.

Errors

An error comes back as an HTTP status and a JSON body in the endpoint's format, with an x-request-id header to quote if you write to us.

Error body
{
  "error": {
    "message": "Invalid API key.",
    "type": "authentication_error",
    "param": null,
    "code": "invalid_api_key"
  }
}
StatusCodeWhat to do
400missing_model, invalid_bodyCheck the body: it needs a model and messages.
401missing_api_key, invalid_api_keyCheck the key you sent.
402insufficient_creditTop up your balance in the dashboard.
429api_key_rpm_exceeded, api_key_concurrency_exceededWait the seconds in Retry-After, then retry. The x-ratelimit-* headers say which limit and when it resets.
502, 503upstream_failed, no_supplyNothing was charged. Retry after the seconds in Retry-After, and back off if it repeats.