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

# Quickstart

## Quick start

The nexos.ai Gateway provides an **OpenAI-compatible API**, so you can use existing OpenAI-compatible SDKs and tools by changing only the API key and base URL.

### Three steps to your first request

{% stepper %}
{% step %}

### Generate an API key

Go to [**Gateway → API keys**](https://workspace.nexos.ai/gateway/api-keys) and click **Generate API Key**.

We recommend storing your API key as an environment variable.

```
export NEXOS_API_KEY="nexos-..."
```

{% hint style="info" %}
Keep your API key secure. Never commit it to source control or expose it in client-side applications.
{% endhint %}
{% endstep %}

{% step %}

### Make your first call

Send a basic chat completion - just a `model` and a `messages` array, where each message has a `role` and `content`.

```bash
curl https://api.nexos.ai/v1/chat/completions \
  -H "Authorization: Bearer $NEXOS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "GPT 5.6 Sol",
    "messages": [
      { "role": "user", "content": "Hello, world!" }
    ]
  }'
```

You can get list of available models here: <https://docs.nexos.ai/gateway-api/models>
{% endstep %}

{% step %}

### Use the Python SDK

Because the Gateway is OpenAI-compatible, you can use the official OpenAI SDK. Simply set your nexos.ai API key and Gateway base URL.

Install the SDK

```bash
pip install openai
```

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.nexos.ai/v1",
    api_key="YOUR_NEXOS_API_KEY",
)

response = client.chat.completions.create(
    model="GPT 5.6 Sol",
    messages=[
        {"role": "user", "content": "Hello, world!"},
    ],
)

print(response.choices[0].message.content)
```

{% endstep %}
{% endstepper %}

That's it — swap the `model` value to route the same request to any model in your Gateway.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.nexos.ai/gateway-api/quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
