# 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)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arcee.ai/arcee-conductor/features-and-functionality/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
