> For the complete documentation index, see [llms.txt](https://docs.arcee.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arcee.ai/arcee-conductor/features-and-functionality/api.md).

# API

You can directly invoke Arcee Conductor via API. The Conductor API uses an OpenAI compatible endpoint making it very easy to update current applications to use Conductor.&#x20;

### Create API Key

To use the API, you first need to generate an API key.

<figure><img src="/files/OWPA4frjhLBMEV1vdi5u" alt="" width="375"><figcaption><p>Select API Key</p></figcaption></figure>

Select your account at the bottom left of the page, and select "API Keys". Click "Create API Key" in the top right.

<figure><img src="/files/aQVOwbZauwRDpZ9p7vgw" alt="" width="375"><figcaption><p>Create API Key</p></figcaption></figure>

Provide a label/name for the key and click "Create API key". Make sure to save the key in a secure location as once you leave the page, you will not be able to view the key again. If you misplace a key, you should delete the old key and create a new one.

### API Syntax

**Request Syntax:**

```
POST https://models.arcee.ai/v1/chat/completions
Authorization: Bearer <YOUR_ARCEE_TOKEN>
Content-Type: application/json

{
  "model": "auto",
  "messages": [
    {
      "role": "user",
      "content": "Your prompt here"
    }
  ]
}
```

### Curl

```
curl -X POST https://models.arcee.ai/v1/chat/completions \
  -H "Authorization: Bearer $ARCEE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "model": "auto",
        "messages": [
          {
            "role": "user",
            "content": "Your prompt here"
          }
        ]
      }'
```

### Python

```python
# First, install the openai packages
# pip install openai

# Be sure to set the following environment variables
# OPENAI_BASE_URL="https://models.arcee.ai/v1"
# OPENAI_API_KEY="$ARCEE_TOKEN"

from openai import OpenAI

client = OpenAI()
response = client.chat.completions.create(
  model='auto',
  messages=[{'role': 'user', 'content': 'Your prompt here'}],
  temperature=0.4,
)

print(response)
```
