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

# AtlasFlux request and response formats

> Compare the /v1/responses native format and /v1/chat/completions OpenAI-compatible format, with request parameters, response fields, and usage metadata.

## Endpoints

AtlasFlux provides two main API endpoints:

| Endpoint                    | Format            | Use Case                           |
| --------------------------- | ----------------- | ---------------------------------- |
| `POST /v1/responses`        | AtlasFlux native  | Recommended for new integrations   |
| `POST /v1/chat/completions` | OpenAI-compatible | Drop-in replacement for OpenAI SDK |

## Request body

Both endpoints accept similar parameters:

| Parameter            | Type           | Description                                                           |
| -------------------- | -------------- | --------------------------------------------------------------------- |
| `model`              | string         | Model identifier. Currently only `atlasflux/nenas-flash` is accepted. |
| `input` / `messages` | string / array | Your prompt or message array                                          |
| `max_output_tokens`  | integer        | Maximum tokens to generate (1–32,000)                                 |
| `temperature`        | float          | Sampling temperature (0–2)                                            |
| `reasoning`          | object         | Object containing an `effort` value: `low`, `medium`, or `high`       |
| `web_search`         | object         | Web search configuration                                              |
| `stream`             | boolean        | Enable streaming response                                             |

## Response structure

### Responses endpoint

```json theme={null}
{
  "id": "resp_arq_...",
  "object": "response",
  "finish_reason": "stop",
  "output_text": "The response text...",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 48,
    "reasoning_tokens": 0,
    "cached_tokens": 0,
    "total_tokens": 60,
    "cost_myr": "0.001260",
    "latency_ms": 1234
  },
  "routing": {
    "category": "general",
    "upstream_model": "atlasflux/nenas-flash"
  },
  "citations": []
}
```

### Chat Completions endpoint

```json theme={null}
{
  "id": "chatcmpl_arq_...",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The response text..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 48,
    "reasoning_tokens": 0,
    "cached_tokens": 0,
    "total_tokens": 60
  },
  "cost_myr": "0.001260"
}
```

## Cost display

All costs are returned as strings in MYR (Malaysian Ringgit). The `cost_myr` field shows the settled request cost with six decimal places. For example, `"0.000431"` means RM0.000431, not RM0.00.

`cached_tokens` is a provider-reported subset of input usage. It is shown separately for observability and is billed at the standard input-token rate. Failed requests return an error instead of a completion response and are recorded with zero cost.

`output_tokens` (or Chat Completions `completion_tokens`) counts visible generated tokens and excludes `reasoning_tokens`; `total_tokens` adds input, visible output, and reasoning exactly once. A `finish_reason` of `length` means the generated-token limit was reached and the response may be incomplete.
