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

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# Embeddings

> Wandle Text und andere Eingaben mit POST /v1/embeddings aus jedem Phaseo-SDK in Vektoren um.

Sende Text an `POST /v1/embeddings`, um für jede Eingabe einen Vektor zurückzubekommen. Die Beispiele verwenden einen `client`, der wie unter [Installation](https://phaseo.app/docs/de/v1/sdk-reference/client/installation.md) erstellt wurde.

```typescript TypeScript theme={null}
const embedding = await client.generateEmbedding({
  model: "openai/text-embedding-3-large",
  input: "Sample text",
});
```

```python Python theme={null}
embedding = client.generate_embedding({
    "model": "openai/text-embedding-3-large",
    "input": "Sample text",
})
```

```go Go theme={null}
resp, err := client.GenerateEmbedding(context.Background(), map[string]interface{}{
  "model": "openai/text-embedding-3-large",
  "input": "Sample text",
})
if err != nil {
  panic(err)
}
fmt.Println(resp["data"])
```

```csharp C# theme={null}
var response = await client.CreateEmbedding(new Dictionary<string, object>
{
    ["model"] = "openai/text-embedding-3-large",
    ["input"] = "Sample text",
});
```

```php PHP theme={null}
$response = $client->generateEmbedding([
    'model' => 'openai/text-embedding-3-large',
    'input' => 'Sample text',
]);
```

```ruby Ruby theme={null}
response = client.generate_embedding(
  model: 'openai/text-embedding-3-large',
  input: 'Sample text'
)
```

```java Java theme={null}
String body = """
{
  "model": "openai/text-embedding-3-large",
  "input": "Sample text"
}
""";

Object response = client.createEmbedding(new com.fasterxml.jackson.databind.ObjectMapper().readTree(body));
System.out.println(String.valueOf(response));
```

```rust Rust theme={null}
// Noch keine Embeddings-Methode: post() sendet JSON an jeden Phaseo-Pfad.
let response = client.post("/embeddings", &json!({
    "model": "openai/text-embedding-3-large",
    "input": "Sample text"
}))?;
```

| Sprache | Methode | Rückgabe |
| - | - | - |
| TypeScript | `client.generateEmbedding(request)` | Die typisierte Antwort |
| Python | `client.generate_embedding(request)` oder `client.embeddings.create(request)` | Ein Dict |
| Go | `client.GenerateEmbedding(ctx, req)`, Alias `CreateEmbedding` | `map[string]interface{}` |
| C# | `client.CreateEmbedding(request)` | `Dictionary<string, object>?` |
| PHP | `$client->generateEmbedding($request)`, Alias `createEmbedding()` | Ein Array |
| Ruby | `client.generate_embedding(...)`, Alias `create_embedding` | Ein Hash |
| Java | `client.createEmbedding(jsonNode)` | `Object` |
| Rust | `client.post("/embeddings", &request)` | `PhaseoResponse`, mit dem JSON in `body` |

## Parameter

Die Feldnamen sind in jedem SDK die Felder des JSON-Bodys.

| Feld | Hinweise |
| - | - |
| `model` | Erforderlich. Eine Embedding-Modell-ID. |
| `input` | Erforderlich. Ein String, ein Array von Strings oder multimodale Content-Parts (Text, Bild, Audio, Video) für Modelle, die sie akzeptieren. |
| `encoding_format` | `float` (Standard), `base64`, `base64_int8` oder `base64_binary`. |
| `dimensions` | Eine positive Ganzzahl, die jeden Vektor kürzt, bei Modellen, die das unterstützen. |
| `provider_options` | Anbietereinstellungen, etwa `task_type` und `title` bei Google oder `output_dtype` bei Mistral. |
| `user` | Kennung des Endnutzers. |

Das vollständige Schema steht in der [Embeddings-API-Referenz](https://phaseo.app/docs/de/v1/api-reference/endpoint/embeddings.md).

## Antwort

```json theme={null}
{
  "data": [
    {
      "embedding": [0.1, 0.2, 0.3],
      "index": 0
    }
  ],
  "usage": {
    "input_tokens": 5,
    "output_tokens": 0,
    "total_tokens": 5,
    "embedding_tokens": 5
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.