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

# Quickstart

> Make your first API call to AtlasFlux in under 2 minutes.

## Prerequisites

* An [AtlasFlux Developer Account](https://platform.atlasflux.my)
* An API key (create one in the [Dashboard](https://platform.atlasflux.my/dashboard/api-keys))
* Wallet credit loaded

## 1. Set your API key

Store your API key as an environment variable. Never hardcode it in source code.

```bash theme={null}
export ATLASFLUX_API_KEY="af_live_YOUR_KEY_HERE"
```

## 2. Make your first request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.atlasflux.my/v1/responses \
    -H "Authorization: Bearer $ATLASFLUX_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": "What is the capital of Malaysia?",
      "max_output_tokens": 256
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.atlasflux.my/v1/responses", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${process.env.ATLASFLUX_API_KEY}`,
    },
    body: JSON.stringify({
      input: "What is the capital of Malaysia?",
      max_output_tokens: 256,
    }),
  });

  const data = await response.json();
  console.log(data.output_text);
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://api.atlasflux.my/v1/responses", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${process.env.ATLASFLUX_API_KEY}`,
    },
    body: JSON.stringify({
      input: "What is the capital of Malaysia?",
      max_output_tokens: 256,
    }),
  });

  const data = await response.json();
  console.log(data.output_text);
  ```

  ```python Python theme={null}
  import requests
  import os

  response = requests.post(
      "https://api.atlasflux.my/v1/responses",
      headers={
          "Content-Type": "application/json",
          "Authorization": f"Bearer {os.environ['ATLASFLUX_API_KEY']}",
      },
      json={
          "input": "What is the capital of Malaysia?",
          "max_output_tokens": 256,
      },
  )

  data = response.json()
  print(data["output_text"])
  ```
</CodeGroup>

## 3. Read the response

A successful response includes:

* `output_text` — The model's text response
* `usage` — Token counts and cost
* `routing` — Which routing category was used

```json theme={null}
{
  "output_text": "The capital of Malaysia is Kuala Lumpur...",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 48,
    "cost_myr": "0.00"
  }
}
```

## 4. Check your usage

View your usage and balance in the [Developer Dashboard](https://platform.atlasflux.my/dashboard/overview).

## Next Steps

* [Streaming](/guides/streaming-responses) — Get real-time token-by-token output
* [Web Search](/concepts/requests-and-responses) — Add web search to any request
* [Error Handling](/guides/handling-errors) — Handle errors gracefully
