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

# Text Generation

> Generate text with the AtlasFlux API.

## Basic text generation

Send a prompt to the `/v1/responses` endpoint:

```bash theme={null}
curl https://api.atlasflux.my/v1/responses \
  -H "Authorization: Bearer $ATLASFLUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Explain quantum computing in simple terms",
    "max_output_tokens": 512,
    "temperature": 0.7
  }'
```

## With reasoning

Enable reasoning for complex tasks:

```bash theme={null}
curl https://api.atlasflux.my/v1/responses \
  -H "Authorization: Bearer $ATLASFLUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Solve this step by step: If a train travels 120km in 2 hours, what is its average speed?",
    "reasoning": {"effort": "medium"},
    "max_output_tokens": 1024
  }'
```

## OpenAI-compatible format

Use `/v1/chat/completions` if you prefer the OpenAI message format:

```bash theme={null}
curl https://api.atlasflux.my/v1/chat/completions \
  -H "Authorization: Bearer $ATLASFLUX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is the capital of Japan?"}
    ],
    "max_tokens": 256,
    "temperature": 0.5
  }'
```

## Temperature guide

| Value | Behavior                    |
| ----- | --------------------------- |
| 0.0   | Deterministic, most focused |
| 0.3   | Conservative, low variation |
| 0.7   | Balanced (default)          |
| 1.0   | Creative, high variation    |
| 2.0   | Maximum randomness          |
