---
title: "Getting started"
description: "From zero to a streaming, memory-backed chat response in three requests."
---

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

# Getting started

Truememory's AI Gateway is OpenAI-compatible: if your code can call OpenAI, pointing it at Truememory is a base-URL change. This page gets you from nothing to a streaming, memory-backed response.

## 1. Get your two inputs

- **Base URL** — Truememory is deployed per environment; the docs use the placeholder `https://your-tie-host`. Ask whoever operates your deployment for your gateway URL.
- **A credential** — either a **user token** (sign a user in through [Truememory Auth](/authentication/email-password/) and use the returned JWT) or, from a backend, the shared **service secret** ([`AUTH_SECRET`](/authentication/service-accounts/), issued by the platform team) with `X-On-Behalf-Of` to act for a user.

## 2. First request

```bash
curl -X POST https://your-tie-host/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "model": "anthropic/claude-sonnet-4-6",
    "messages": [{"role": "user", "content": "Hello! Who are you?"}]
  }'
```

That's a complete integration: the response comes back in OpenAI's shape, and if the user has an [active persona](/ai-gateway/personas/) or existing [memory](/memory/overview/), both were injected automatically — you never manage them per request.

## 3. Stream it

Add `"stream": true` and read Server-Sent Events; content arrives in `choices[0].delta.content` and the stream ends with `data: [DONE]`:

```bash
curl -N -X POST https://your-tie-host/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "model": "anthropic/claude-sonnet-4-6",
    "stream": true,
    "messages": [{"role": "user", "content": "Tell me a two-line poem."}]
  }'
```

## 4. Keep the conversation

Pass a `thread_id` (any stable string you generate) and Truememory persists the conversation so follow-up requests have context:

```bash
curl -X POST https://your-tie-host/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "model": "anthropic/claude-sonnet-4-6",
    "thread_id": "0f2e5f3a-demo-thread",
    "messages": [{"role": "user", "content": "Remember this number: 42"}]
  }'
```

## Where to next

| You want | Go to |
|---|---|
| Every request parameter, tools, caching, compression | [Unified API](/ai-gateway/chat-completions/) |
| A named AI companion with a personality | [Personas](/ai-gateway/personas/) |
| Long-term memory across sessions and apps | [Agent Memory](/memory/overview/) |
| Ground answers in your documents | [Knowledge Packs](/ai-gateway/knowledge-packs/) |
| Speech, images, real-time voice | [Audio](/ai-gateway/audio/) · [Images](/ai-gateway/image-generation/) · [Voice](/ai-gateway/voice/) |
| Which models you can use | [Model catalog](/models/) |

Source: https://truememory-docs.mvstg.com/ai-gateway/quickstart/index.mdx
