# Examples (/examples/overview)



Each example is a self-contained, runnable reference integration with its own README and pinned dependencies. They read the API key from `ZUMIK_API_KEY` and never hardcode it. The source lives in [`examples/`](https://github.com/zumik-ai/zumik/tree/main/examples) in the repository.

```bash
export ZUMIK_API_KEY="zk_..."
# optional, for staging / self-hosted:
# export ZUMIK_BASE_URL="https://api.zumik.ai/v1"      # OpenAI-compatible surface
# export ZUMIK_BASE_URL_V2="https://api.zumik.ai"      # native /v2 surface root
```

<CardGroup cols="2">
  <Card title="OpenAI migration" icon="arrow-right-arrow-left" href="/guides/openai-migration">
    The one-line `base_url` swap from OpenAI to Zumik in Python, TypeScript, Go, and curl. Source: [`examples/openai-migration`](https://github.com/zumik-ai/zumik/tree/main/examples/openai-migration).
  </Card>

  <Card title="Coding agent" icon="robot" href="/examples/coding-agent">
    A coding agent whose repo policy and tool bundle are a stable, reused prefix; streams over `code.fast`. Source: [`examples/coding-agent`](https://github.com/zumik-ai/zumik/tree/main/examples/coding-agent).
  </Card>

  <Card title="RAG" icon="book" href="/examples/rag">
    Retrieved documents pinned to a session and reused across queries. Source: [`examples/rag`](https://github.com/zumik-ai/zumik/tree/main/examples/rag).
  </Card>

  <Card title="Agent runtime" icon="layer-group" href="/examples/agent-runtime">
    A multi-turn agent loop on the native `/v2` session/branch surface with interactive QoS. Source: [`examples/agent-runtime`](https://github.com/zumik-ai/zumik/tree/main/examples/agent-runtime).
  </Card>
</CardGroup>

## What they share [#what-they-share]

The three native examples (coding agent, RAG, agent runtime) all follow the same reuse pattern: upload stable content as immutable [artifacts](/concepts/artifacts), assemble it into an `agent_prefix` [bundle](/concepts/overview), pin the bundle to a [session](/concepts/sessions), then run turns against the session so the compiled prefix is reused instead of resent. The reuse is reported on the response, never guessed - see [reuse metrics](/concepts/reuse-metrics).

They talk to the API with `httpx` (native `/v2`) and the official `openai` client (compatible `/v1` stream) directly, so they have no dependency on an unpublished SDK. If you prefer the first-party SDK, install the [Python SDK](/sdk/python) - it calls the same endpoints. The examples are intentionally outside the pnpm and Cargo workspace so they stand alone.

## Before you run [#before-you-run]

You need an API key and a prepaid credit balance; inference is blocked until your balance is funded. See the [quickstart](/quickstart) and [authentication](/authentication).
