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

# Create answer

> Answers a question about aviation operations from radio transcripts, ADS-B, FAA SWIM records, weather, and the web, with the evidence behind it.

Answers a question about aviation operations by researching radio transcripts from channels available to the API, ADS-B aircraft positions, FAA SWIM records (ground stops, flow programs, EDCTs, holds, diversions, airport configuration, surface movements), weather, and the public web. Returns the answer and the records it rests on.

Nothing is stored between requests. To ask a follow-up, send the earlier questions and answers again in `messages`, with the new question last. Earlier answers are used only to understand what the new question refers to; every answer is researched again from the records.

> [!NOTE]
>
> An answer usually takes from several seconds to a few minutes. Keep the connection open until the response arrives. If the connection closes first, research stops and nothing is charged.

<video controls preload="none" playsInline src="https://enhancedradar.com/media/api/api-06-answers-v1.mp4" poster="https://enhancedradar.com/media/api/api-06-answers-poster-v1.jpg" />

## Body

JSON, at most 256 KiB.

**messages** `object[]` *required*

The conversation, oldest first, 1 to 40 messages. Each is `{"role": "user" | "assistant", "content": "..."}`. The last message must have role `user`.

**format** `string` (default: text)

`text`, `markdown`, or `json`. `markdown` quotes transmissions as links of the form `[words](audio:<audio_sample_id>)`.

**json\_schema** `object`

Required with `format` `json`; not accepted with other formats. A JSON Schema object describing the answer, e.g. `{"type": "object", "properties": {"diverted": {"type": "boolean"}}}`. The answer is written to follow it but is not validated against it.

**record\_limit** `integer` (default: 5000)

Most records to review, 300 to 50000. Research stops when it is reached, and the answer says what could not be checked. Lowered to what the organization's available balance covers.

This is also the most records one answer can be charged for. Each record reviewed costs \$0.01; for example, an answer that reviews 418 records, like the example response below, costs \$4.18.

**evidence\_limit** `integer` (default: 25)

Most evidence records to return, 0 to 50.

## Response

**format** `string`

The format of the answer.

**answer\_text** `string`

The answer, for formats `text` and `markdown`.

**answer\_json** `any`

The answer, for format `json`.

**evidence** `object`

The records the answer rests on, at most `evidence_limit` in total, most important first within each list. Every record was retrieved while answering.

**properties**

**transcripts** `array`

Transmissions, in the shape of [Get transcript](https://enhancedradar.com/docs/api/docs/api/api-reference/transcripts/get.md).

**swim\_records** `array`

FAA SWIM records: `source_tool` names the kind of record (`surface_timeline`, `ground_stops`, `airport_config`, `edcts`, `holds`, or `diversions`), `source_record_id` identifies it, and `record` holds its fields.

**adsb\_positions** `array`

ADS-B aircraft positions: `icao_hex`, `callsign`, `registration`, `seen_at`, `latitude`, `longitude`, `altitude_ft_baro` (feet, or `"ground"`), `ground_speed_kts`, `track_degrees`, and `squawk`.

**web\_pages** `array`

Web pages that were read: `url`, `title`, and `published_at` when the page states it.

**records\_reviewed** `object`

Transmissions, ADS-B positions, and SWIM records reviewed while answering, and their `total`.

**record\_limit** `integer`

The record limit used, after lowering it to what the organization's available balance covers.

**is\_record\_limit\_reached** `boolean`

Whether research stopped at the record limit.

**records\_charged** `integer`

Records charged: `records_reviewed.total`, at least 300 and at most `record_limit`.

> [!WARNING]
>
> Answers are written by a language model from the records it reviewed and can contain mistakes. Check important details against the evidence.

## Billing

Each record reviewed is charged as one `answer_record`, at \$0.01. An answer is charged for `records_charged` records: at least 300 and at most `record_limit`. See [Pricing](https://enhancedradar.com/docs/api/docs/api/pricing.md).

The `X-Charged-Usd` and `X-Balance-Usd` response headers report the charge and the remaining balance in US dollars with three decimal places.

Nothing is charged when an answer fails (`502`), including when the client disconnects before the response. A request is never deduplicated: retrying it starts a new answer, which is researched and charged again. See [Billing](https://enhancedradar.com/docs/api/docs/api/concepts/billing.md).

## Errors

| Status | Meaning |
| - | - |
| `400` | The body is not valid JSON, or a field is missing or invalid. `error` says which. |
| `402` | The organization's available balance does not cover the \$3.00 minimum (300 records). This is checked before research starts. |
| `403` | The key is not owned by an organization, or charging the answer would go over a limit of the organization's account tier. The tier limit is checked when the answer is charged, after research; the answer is not returned and nothing is charged. |
| `502` | The answer could not be produced. Nothing is charged. Retry later. |

```bash cURL theme={null}
curl -X POST -H "Authorization: Bearer $ER_API_KEY" -H "Content-Type: application/json" \
  "https://api.enhancedradar.com/api/v0/answers" \
  -d '{"messages": [{"role": "user", "content": "Did United 254 divert last night?"}], "record_limit": 1000, "format": "json", "json_schema": {"type": "object", "properties": {"diverted": {"type": "boolean"}, "diversion_airport": {"type": "string"}}}}'
```

```json 200 theme={null}
{
  "format": "json",
  "answer_json": {"diverted": true, "diversion_airport": "KDEN"},
  "evidence": {
    "transcripts": [
      {
        "audio_sample_id": "0000067e-8b4f-47cf-9a62-69d24bc0c5dd",
        "received_at": "2026-10-27T03:31:12.48Z",
        "duration_seconds": 4.2,
        "atc_channel_id": 812,
        "facility_ids": ["ae40254d-1aeb-4a43-93b5-82d7e61d1202"],
        "is_controller_speaking": false,
        "callsigns": ["UAL254"],
        "transcript": "Mayday, mayday, mayday, United 254, engine failure, request Denver",
        "word_timestamps": []
      }
    ],
    "swim_records": [
      {
        "source_tool": "diversions",
        "source_record_id": 88213,
        "record": {"source_record_id": 88213, "callsign": "UAL254", "departure_airport_id": 3702, "original_destination_airport_id": 3618, "diversion_airport_id": 3505, "diversion_indicator": "DV", "source_timestamp": "2026-10-27T03:40:02Z"}
      }
    ],
    "adsb_positions": [],
    "web_pages": []
  },
  "records_reviewed": {"transmissions": 412, "adsb_positions": 0, "swim_records": 6, "total": 418},
  "record_limit": 1000,
  "is_record_limit_reached": false,
  "records_charged": 418
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.