API Usage

Shared Inference and Dedicated Deployments both speak the OpenAI API. Any OpenAI SDK or curl works by pointing it at the cyankiwi base URL with your API key.

Service Base URL model
Shared Inference https://api.cyan.kiwi/v1 an id from GET /v1/models
Dedicated Deployments https://api.cyan.kiwi/serverless your deployment’s model name

1. Get an API key

Sign in and open the Account tab of the workspace, then click Create key. The key is shown once, so store it somewhere safe, such as an environment variable, and never in client-side code. The examples below read it from CYANKIWI_API_KEY.

One key works for both services. Add credits on the Account tab before your first request.

2. Shared Inference

List the models (no key needed):

curl https://api.cyan.kiwi/v1/models

Send a chat completion, using an id from that list as model:

curl https://api.cyan.kiwi/v1/chat/completions \
  -H "Authorization: Bearer $CYANKIWI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Stream the response by adding "stream": true:

curl -N https://api.cyan.kiwi/v1/chat/completions \
  -H "Authorization: Bearer $CYANKIWI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Count to five."}],
    "stream": true
  }'

Python (OpenAI SDK)

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.cyan.kiwi/v1",
    api_key=os.environ["CYANKIWI_API_KEY"],
)

print([m.id for m in client.models.list()])

resp = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

# streaming
for chunk in client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Count to five."}],
    stream=True,
):
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="")

3. Dedicated Deployments

List your deployments. Each id is the model name to send:

curl https://api.cyan.kiwi/serverless/models \
  -H "Authorization: Bearer $CYANKIWI_API_KEY"

Send a chat completion, replacing your-model-name with your deployment’s model name (also shown on the Deployment tab):

curl https://api.cyan.kiwi/serverless/chat/completions \
  -H "Authorization: Bearer $CYANKIWI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-name",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Add "stream": true to stream, as with Shared Inference.

Python (OpenAI SDK)

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.cyan.kiwi/serverless",
    api_key=os.environ["CYANKIWI_API_KEY"],
)

resp = client.chat.completions.create(
    model="your-model-name",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

# streaming
for chunk in client.chat.completions.create(
    model="your-model-name",
    messages=[{"role": "user", "content": "Count to five."}],
    stream=True,
):
    if chunk.choices:
        print(chunk.choices[0].delta.content or "", end="")

Node (OpenAI SDK)

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.cyan.kiwi/serverless",
  apiKey: process.env.CYANKIWI_API_KEY,
});

const resp = await client.chat.completions.create({
  model: "your-model-name",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

4. Streaming and errors

Streams are standard server-sent events. A stream that finishes successfully ends with data: [DONE]; one that ends without it did not complete, even if no error arrived. Errors use the standard OpenAI envelope, so SDK exception handling works unchanged. Each service’s error codes and limits are on its page: Shared Inference and Dedicated Deployments.