In this section: Chat API overview

Chat API overview

Use the OpenAI-compatible Chat API to get the answer Miles would give on askmiles.ai.

What it is

https://askmiles.ai/v1 is an OpenAI-compatible chat completions endpoint. Point a server-side OpenAI client at it and ask a card or points question in natural language. It returns the complete answer Miles would give on askmiles.ai, using the same tools and data.

Base URLhttps://askmiles.ai/v1
Modelmiles. It is the only one; /v1/models returns it and nothing else, and any other model value is echoed but not honored.
EndpointsPOST /v1/chat/completions, GET /v1/models, GET /v1/health (no auth; answers whether something can serve a completion, not whether the site is up).
AuthenticationA bearer token: a personal API key for your own account, or an OAuth access token with scope miles:chat for someone else's.

Limits

  • Miles stores no conversation state, so send the full messages array every turn; Miles reads the new question and the last 26 earlier messages.
  • Tools are read-only for every token scope, so caller-supplied messages cannot trigger wallet writes.
  • Put relevant context in the user turn because Miles passes system messages through as caller data and follows its own framing.
  • Only system, user and assistant roles; there is no tool role. Image and audio parts return 400 naming the part type.
  • Call the endpoint from a server or agent; browser clients are unsupported.

Timing

A non-streaming turn times out at 90 seconds. A streaming turn has no turn timeout. It sends no data: event until the answer starts, which can take tens of seconds, longer with tool rounds. While the classification and tool stages run, it sends a : keepalive SSE comment after each 15 seconds without a frame, which OpenAI clients skip.

Response extras

Non-streaming responses include a miles object with tools_called and duration_ms, which report the tools used and turn duration. Streaming responses omit the miles object. The miles object is outside the OpenAI response shape and can be ignored if you do not need it.

Third-party callers

A token minted to a registered OAuth app is treated as an outside agent: tool results pass through the wallet-field redaction the MCP server applies to every connection before synthesis, and a field it withholds is marked as withheld. A personal API key is the member and sees everything.