CedarLLM

API quickstart

CedarLLM is an OpenAI-compatible API. Any app or library that lets you set a custom OpenAI base URL works with it.

Base URLhttps://api.cedarllm.com/v1
Modelsqwen3.8-27b
qwen3-coder-next
Context262,144 tokens (both)
Pricefrom $0.03 / M input
see Models

Models

ModelBest forInputOutput
qwen3.8-27bGeneral chat, thinking, images, tool calling, JSON. Fastest (about 35 tokens/s).$0.03 / M$1.15 / M
qwen3-coder-nextCoding and coding agents: writing and editing code, tool calling. Text only, no thinking mode. About 20 tokens/s.$0.12 / M$0.80 / M

Both take up to 262,144 tokens per request. Choose the model with the model field; the examples below use qwen3.8-27b, and they all work with qwen3-coder-next too, except thinking and images.

1. Get an API key

  1. Create an account and confirm your email address.
  2. Open Wallet and add credit with a card (minimum $5).
  3. Open API Keys, create a key and copy it. It starts with sk-. Treat it like a password.

2. Make a request

curl

curl https://api.cedarllm.com/v1/chat/completions \
  -H "Authorization: Bearer $CEDARLLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.8-27b",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Python (pip install openai)

from openai import OpenAI

client = OpenAI(base_url="https://api.cedarllm.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
    model="qwen3.8-27b",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

JavaScript (npm install openai)

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.cedarllm.com/v1", apiKey: process.env.CEDARLLM_API_KEY });
const resp = await client.chat.completions.create({
  model: "qwen3.8-27b",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

Streaming

Add "stream": true (or stream=True in Python) to receive the reply as it is generated. Use streaming for long replies: a non-streamed request that runs longer than about 100 seconds can be cut off by our network provider.

3. Thinking (reasoning)

Thinking is available on qwen3.8-27b only (qwen3-coder-next always answers directly). It is off by default, for fast answers. Turn it on for harder problems with "reasoning_effort": "high" (any value except "none"; low, medium and high all switch thinking on, there is no separate effort level), or "reasoning": {"enabled": true}, or "chat_template_kwargs": {"enable_thinking": true}. "reasoning_effort": "none" turns it off. When it is on, the reasoning is returned separately in message.reasoning_content (streamed in delta.reasoning_content), and the final answer is in message.content. Reasoning tokens count as output tokens.

{
  "model": "qwen3.8-27b",
  "chat_template_kwargs": {"enable_thinking": true},
  "messages": [{"role": "user", "content": "What is 17 * 23?"}]
}

4. Images

qwen3.8-27b can read pictures (photos, screenshots, scanned pages); qwen3-coder-next is text only. Send them in OpenAI's format, either as a normal https:// link or embedded as a data: URL (base64). An image costs input tokens like text (typically a few hundred per image). Images are processed on the server's CPU, so allow a second or two extra per image.

{
  "model": "qwen3.8-27b",
  "messages": [{
    "role": "user",
    "content": [
      {"type": "text", "text": "What is in this picture?"},
      {"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
    ]
  }]
}

Python, with a local file:

import base64
from openai import OpenAI

client = OpenAI(base_url="https://api.cedarllm.com/v1", api_key="YOUR_KEY")
b64 = base64.b64encode(open("photo.jpg", "rb").read()).decode()
resp = client.chat.completions.create(
    model="qwen3.8-27b",
    messages=[{"role": "user", "content": [
        {"type": "text", "text": "Describe this image."},
        {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{b64}"}},
    ]}],
)
print(resp.choices[0].message.content)

5. Tool calling (function calling)

Describe your functions in tools. When the model wants one, the reply has finish_reason: "tool_calls" and a tool_calls list (it can ask for several at once). Run the function yourself, send the result back as a {"role": "tool", "tool_call_id": ..., "content": ...} message, and the model writes its final answer.

from openai import OpenAI
import json

client = OpenAI(base_url="https://api.cedarllm.com/v1", api_key="YOUR_KEY")
tools = [{"type": "function", "function": {
    "name": "get_weather",
    "description": "Get the current weather for a city",
    "parameters": {"type": "object",
                   "properties": {"city": {"type": "string"}},
                   "required": ["city"]}}}]
messages = [{"role": "user", "content": "What's the weather in Portland, Oregon?"}]

resp = client.chat.completions.create(model="qwen3.8-27b", messages=messages, tools=tools)
msg = resp.choices[0].message
if msg.tool_calls:
    messages.append(msg)
    for call in msg.tool_calls:
        args = json.loads(call.function.arguments)
        result = {"city": args["city"], "temp_f": 54, "sky": "cloudy"}   # your real lookup here
        messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})
    resp = client.chat.completions.create(model="qwen3.8-27b", messages=messages, tools=tools)
print(resp.choices[0].message.content)

6. Web search, file uploads and chat apps

The API itself does not browse the web or read PDF/Word files; it works with the text and images you send. To get search, document uploads and chat history, use an app that adds these on top of any OpenAI-compatible API. It runs the searches and extracts text from your files, then sends it to CedarLLM. For example:

In any of them, add an "OpenAI-compatible" (or "custom OpenAI") provider with:

SettingValue
Base URL / API hosthttps://api.cedarllm.com/v1 (some apps want just https://api.cedarllm.com)
API keyyour sk-... key
Modelqwen3.8-27b (or qwen3-coder-next for coding)

Web search in these apps uses a search provider you set up in the app; the searches themselves are not billed by CedarLLM, but the page text the app sends to the model counts as input tokens. Coding assistants and other tools that accept a custom OpenAI endpoint work the same way; for coding agents, qwen3-coder-next is the better fit.

Pricing and billing

ModelInput (prompt) tokensOutput (completion) tokens
qwen3.8-27b$0.03 per million$1.15 per million
qwen3-coder-next$0.12 per million$0.80 per million

Credit is prepaid in US dollars and deducted per request. Your dashboard shows every request's token counts and cost. Requests that fail are not charged.

Limits and good to know

Common errors

CodeMeaning
401Missing or wrong API key.
403Not enough credit, or the key is disabled or expired. Top up in Wallet or check the key.
429Too many requests, or qwen3.8-27b is at capacity (all request slots busy; we answer at once instead of queueing). Wait a moment (see the Retry-After header) and retry.
503Unknown model name (use qwen3.8-27b or qwen3-coder-next) or the server is temporarily unavailable.

Open the dashboard