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

# Overview

> The fundamental building blocks behind every Routeway API call.

Before diving into advanced guides, it helps to understand a handful of concepts that underpin every request you make through Routeway. This section covers them in depth — read it once and the rest of the docs will make much more sense.

## What's in this section

### Chat Completions

<CardGroup cols={2}>
  <Card title="Messages & Roles" icon="messages-square" href="/core-concepts/chat-completions/messages-and-roles">
    How the `messages` array works, what `system`, `user`, and `assistant` roles do, and how to build multi-turn conversations correctly.
  </Card>

  <Card title="Tokens & Context" icon="hash" href="/core-concepts/chat-completions/tokens-and-context">
    What tokens are, how context windows limit request size, and how to manage long conversations without hitting the limit or running up costs.
  </Card>

  <Card title="Models & Providers" icon="microchip" href="/core-concepts/chat-completions/models-and-providers">
    How Routeway routes a request to the right upstream provider, how to pick the right model for your use case, and how to pin versions for stable production behavior.
  </Card>

  <Card title="Request & Response" icon="arrow-right-left" href="/core-concepts/chat-completions/request-and-response">
    The full anatomy of a chat completion request and response — every key parameter, what `finish_reason` values mean, and how errors are shaped.
  </Card>
</CardGroup>

### Responses

<CardGroup cols={2}>
  <Card title="Request & Response" icon="arrow-right-left" href="/core-concepts/responses/request-and-response">
    The full anatomy of a Responses API request and response — input formats, output structure, and key parameters.
  </Card>

  <Card title="Multi-turn Conversations" icon="messages-square" href="/core-concepts/responses/multi-turn">
    Use `previous_response_id` to build stateful conversations without resending full message history.
  </Card>

  <Card title="Built-in Tools" icon="wrench" href="/core-concepts/responses/built-in-tools">
    Leverage web search, file search, and code interpreter without defining custom function schemas.
  </Card>
</CardGroup>

### Image Generation

<CardGroup cols={2}>
  <Card title="Generating Images" icon="wand-sparkles" href="/core-concepts/image-generation/generating-images">
    Turn a text prompt into an image. Covers models, sizes, quality presets, response formats, and saving images locally.
  </Card>

  <Card title="Editing Images" icon="pencil" href="/core-concepts/image-generation/editing-images">
    Modify an existing image with a prompt and optional mask. Covers inpainting, multi-image edits, and advanced parameters like `strength` and `guidance_scale`.
  </Card>
</CardGroup>

***

## Where to go next

Once you're comfortable with these fundamentals, the [Guides](/guides/chat-completions/overview) show you how to use streaming, tool calling, structured outputs, reasoning models, multimodal inputs, and caching — all of which build directly on what's covered here.
