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

# Quickstart

Go from zero to your first AI-generated response in under five minutes.

## 1. Create an account

Sign up at [app.dos.ai](https://app.dos.ai). Every new account receives **$5 in free credits** -- no credit card required.

## 2. Get your API key

1. Log in to the [DOS AI dashboard](https://app.dos.ai).
2. Navigate to **API Keys** in the sidebar.
3. Click **Create new key**.
4. Copy the key (it starts with `dos_sk_`). Store it somewhere safe -- you won't be able to see it again.

## 3. Make your first request

DOS AI is fully compatible with the OpenAI SDK. Install it and point it at our API.

### Python

```bash
pip install openai
```

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.dos.ai/v1",
    api_key="dos_sk_...",  # Replace with your key
)

response = client.chat.completions.create(
    model="dos-ai",
    messages=[
        {"role": "user", "content": "What is the capital of France?"}
    ],
)

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

### JavaScript / TypeScript

```bash
npm install openai
```

```javascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.dos.ai/v1",
  apiKey: "dos_sk_...", // Replace with your key
});

const response = await client.chat.completions.create({
  model: "dos-ai",
  messages: [
    { role: "user", content: "What is the capital of France?" }
  ],
});

console.log(response.choices[0].message.content);
```

### cURL

```bash
curl https://api.dos.ai/v1/chat/completions \
  -H "Authorization: Bearer dos_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dos-ai",
    "messages": [
      {"role": "user", "content": "What is the capital of France?"}
    ]
  }'
```

## 4. Try streaming

Streaming lets you receive tokens as they are generated, giving your users a real-time typing experience.

### Python (streaming)

```python
from openai import OpenAI

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

stream = client.chat.completions.create(
    model="dos-ai",
    messages=[
        {"role": "user", "content": "Write a short poem about open-source AI."}
    ],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)
print()
```

### JavaScript (streaming)

```javascript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.dos.ai/v1",
  apiKey: "dos_sk_...",
});

const stream = await client.chat.completions.create({
  model: "dos-ai",
  messages: [
    { role: "user", content: "Write a short poem about open-source AI." }
  ],
  stream: true,
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) process.stdout.write(content);
}
console.log();
```

### cURL (streaming)

```bash
curl https://api.dos.ai/v1/chat/completions \
  -H "Authorization: Bearer dos_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dos-ai",
    "messages": [
      {"role": "user", "content": "Write a short poem about open-source AI."}
    ],
    "stream": true
  }'
```

## 5. Explore further

* **Manage your keys**: [Authentication](/getting-started/authentication.md)
* **Migrate from OpenAI**: [OpenAI Compatibility](/getting-started/openai-compatibility.md)
* **Check available models**: `GET https://api.dos.ai/v1/models`

> **Tip:** Since DOS AI is OpenAI-compatible, any tutorial, library, or framework that works with the OpenAI API also works with DOS AI. Just change the base URL and API key.


---

# 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:

```
GET https://docs.dos.ai/getting-started/quickstart.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.
