API Usage

Dedicated Deployments speak the OpenAI API. Point an OpenAI SDK or curl at https://api.cyan.kiwi/serverless with your API key and your deployment’s model name.

1. Get an API key

Sign in and open the Account tab of the workspace, then click Create key to create a cyankiwi ck- API key for dedicated deployments. 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.

Each key works for your endpoints. The default maximum is three active keys per account. The Account tab shows the current key count and maximum. Add an optional name when creating a key. Revoke an individual key there when it is no longer needed; revocation takes effect for new requests immediately. A key cannot be revealed again. Add credits before your first request.

2. 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.

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);

3. 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. Error codes and limits are on the Dedicated Deployments page.