> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Embeddings

Use `titan-embed-text-v2` on the embeddings endpoint for RAG and vector search. It returns a 1024-dimension vector per input.

**`Python`**

```python title="Python"
resp = client.embeddings.create(
    model="titan-embed-text-v2",
    input="Astro AI deploys agents as containers.",
)
vector = resp.data[0].embedding   # list[float], length 1024
```

**`TypeScript`**

```typescript title="TypeScript"
const resp = await client.embeddings.create({
    model: "titan-embed-text-v2",
    input: "Astro AI deploys agents as containers.",
});
const vector = resp.data[0].embedding; // number[], length 1024
```

The client is constructed the same way as for [chat completions](/ai-gateway/chat): base URL `${ASTRO_GATEWAY_URL}/v1`, bearer `ASTRO_GATEWAY_API_KEY`.

## Next steps

* [Knowledge stores](/knowledge-stores): store the vectors somewhere your agents share
* [Supported models](/ai-gateway/models): the full model list