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

# Quickstart

> Create an API key, then send your first chat completion with curl or the official OpenAI SDKs for Python and JavaScript.

The Morse API is compatible with OpenAI's Chat Completions API. Any client that lets you set a base URL can call it.

## Create a key

1. In the Morse app, open **Settings** and choose **API keys**.
2. Click **Create key** and give the key a name.
3. Copy the key. Morse shows it only once.

Store the key in an environment variable on the machine that calls the API:

```bash theme={null}
export MORSE_API_KEY="sk_morse_..."
```

A key pays for every request from your credits. If your balance is empty, buy credits first, or the API answers `402`. See [Billing](/billing).

## Send a request

The base URL is `https://api.trymorse.ai/v1`.

```bash theme={null}
curl https://api.trymorse.ai/v1/chat/completions \
  -H "Authorization: Bearer $MORSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

The reply is a `chat.completion` object in OpenAI's format.

## Use the OpenAI SDKs

Set the SDK's base URL to Morse's and pass your key.

Python:

```python theme={null}
import os
from openai import OpenAI

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

completion = client.chat.completions.create(
    model="glm-5.3",
    messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)
```

JavaScript:

```javascript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.trymorse.ai/v1",
  apiKey: process.env.MORSE_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "glm-5.3",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);
```

Run this code on a server, not in a web page. See [Authentication](/authentication).

## Next steps

* Pick a model and its privacy tier in [Models and privacy tiers](/models).
* Receive replies as the model writes them with [Streaming](/streaming).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.