> ## 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.

# Generierung abrufen

> Rufe mit /generations aus jedem Phaseo-SDK eine frühere Generierung ab.

Übergib eine Anfrage-ID (etwa `G-01ABC...`) an die Generierungsmethode des SDK, um den gespeicherten Datensatz dieser Anfrage von `GET /v1/generations?id=<id>` abzurufen.

```typescript TypeScript theme={null}
const record = await client.getGeneration("G-01ABC...");
```

```python Python theme={null}
record = client.get_generation("G-01ABC...")

print(record["model_id"], record["cost_nanos"])
```

```go Go theme={null}
client, err := phaseo.NewFromEnv()
if err != nil {
  panic(err)
}

record, err := client.GetGeneration(context.Background(), "G-01ABC...")
if err != nil {
  panic(err)
}
fmt.Println(record["status_code"], record["cost_nanos"])
```

```csharp C# theme={null}
using PhaseoSdk;

var client = new Phaseo();
var record = await client.GetGeneration("G-01ABC...");
```

```php PHP theme={null}
<?php
require 'vendor/autoload.php';

use Phaseo\Sdk\Phaseo;

$client = new Phaseo();
$record = $client->getGeneration('G-01ABC...');
```

```ruby Ruby theme={null}
require 'phaseo_sdk'

client = PhaseoSdk::Phaseo.new
record = client.get_generation('G-01ABC...')
```

```java Java theme={null}
import app.phaseo.sdk.Phaseo;

Phaseo client = new Phaseo(System.getenv("PHASEO_API_KEY"));

var record = client.getGeneration("G-01ABC...");
System.out.println(record);
```

| Sprache | Methode | Rückgabe |
| - | - | - |
| TypeScript | `client.getGeneration(id)` | Das Datensatzobjekt |
| Python | `client.get_generation(id)` | `APIResponse`-Dict |
| Go | `client.GetGeneration(ctx, id)` | `map[string]interface{}` |
| C# | `client.GetGeneration(id)` | `Dictionary<string, object>?` |
| PHP | `$client->getGeneration($id)` | Array |
| Ruby | `client.get_generation(id)` | Hash |
| Java | `client.getGeneration(id)` | Jackson-`JsonNode` |
| Rust | Kein Helfer; rufe `client.request("GET", "/generations?id=<id>", None, &RequestOptions::default())` auf | `PhaseoResponse`, der Datensatz steht in `body` (ein `serde_json::Value`) |

Der Abruf ist auf deinen Workspace beschränkt. Eine fehlende `id` gibt `400` (`missing_id`) zurück, eine ID, die nicht zu deinem Workspace gehört, gibt `404` (`not_found`) zurück.

## Gespeicherte Anfrage erneut ausführen

Hat das Gateway die vollständige Anfrage gespeichert, enthält der Datensatz `replay_supported` mit dem Wert true und ein `replay_request`, das du für eine kontrollierte Wiederholung an den ursprünglichen Endpunkt zurücksenden kannst.

## Zeitfelder auslesen

* `latency_ms`: Zeit bis zum ersten Token oder zum ersten Ausgabe-Byte bzw. -Frame, sofern erfasst.
* `generation_ms`: Generierungszeit ab diesem Punkt, sofern erfasst.

## Antwort

```json theme={null}
{
  "created_at": "2026-05-05T12:00:00.000Z",
  "request_id": "G-01ABC123",
  "team_id": "team-123",
  "app_id": "app-123",
  "endpoint": "chat/completions",
  "model_id": "openai/gpt-6-astra",
  "provider": "openai",
  "native_response_id": "chatcmpl-123",
  "stream": false,
  "byok": false,
  "status_code": 200,
  "success": true,
  "error_code": null,
  "error_message": null,
  "latency_ms": 1500,
  "generation_ms": 1400,
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 9,
    "total_tokens": 18
  },
  "cost_nanos": 1000000,
  "currency": "USD",
  "pricing_lines": [],
  "key_id": "key-123",
  "throughput": null,
  "replay_supported": true,
  "replay_request": {
    "model": "openai/gpt-6-astra",
    "messages": [
      { "role": "user", "content": "Say hello" }
    ]
  }
}
```

[Generierung abrufen](https://phaseo.app/docs/de/v1/api-reference/endpoint/generation.md) listet jedes Feld auf.


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