---
title: "Use the API"
description: "Make an API key and call the cluster's model at api.c4e.ai with the OpenAI SDK."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.c4e.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use the API

The model API speaks the OpenAI chat completions format, so the official OpenAI SDKs and most tools that support a custom base URL work with it.

| Setting | Value |
|---|---|
| Base URL | `https://api.c4e.ai/v1` |
| Model | `DeepSeek-V4.1-Flash-1017` |
| Endpoints | `GET /v1/models`, `POST /v1/chat/completions` (streaming supported) |

## Make an API key

1. **Sign in to chat**

   Open [chat.c4e.ai](https://chat.c4e.ai) and [sign in](https://docs.c4e.ai/getting-started/sign-in/).
2. **Open your account settings**

   Click your name, then **Settings**, then **Account**.
3. **Create the key**

   Under **API keys**, create a key and copy it. Treat it like a password: anyone with it can use the model as you.

Keep the key out of code you share. Put it in an environment variable instead:

```sh
export C4E_API_KEY="paste-your-key-here"
```

## Python

Install the official SDK with `pip install openai`, then:

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.c4e.ai/v1",
    api_key=os.environ["C4E_API_KEY"],
)

response = client.chat.completions.create(
    model="DeepSeek-V4.1-Flash-1017",
    messages=[{"role": "user", "content": "Explain unified memory in two sentences."}],
)
print(response.choices[0].message.content)
```

To stream the answer as it's written, pass `stream=True` and print each chunk's `choices[0].delta.content`.

## curl

```sh
curl https://api.c4e.ai/v1/chat/completions \
  -H "Authorization: Bearer $C4E_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "DeepSeek-V4.1-Flash-1017", "messages": [{"role": "user", "content": "Hello"}]}'
```

List the models your key can use with `curl https://api.c4e.ai/v1/models -H "Authorization: Bearer $C4E_API_KEY"`.

## Good to know

- Only the two endpoints above are open. Embeddings, images and other OpenAI endpoints aren't available.
- Busy moments queue rather than fail, so a request may take longer when many people are using the model.
- If you lose a key or think someone else has it, delete it in the same settings page and make a new one.

Source: https://docs.c4e.ai/getting-started/api/index.mdx
