---
slug: design/server_contracts
title: Server Contracts
---
<a id="server-contracts"></a>

FastVideo's typed public API (`fastvideo.api`) is consumed by three
server-class integrations that must share one execution substrate so we
don't grow three near-duplicate progress loops:

| Consumer | Transport | Request shape | State model |
| --- | --- | --- | --- |
| [Stateless OpenAI](/FastVideo/design/server_contracts/openai) | HTTP POST `/v1/videos` | `VideoGenerationsRequest` → `GenerationRequest` merged onto `ServeConfig.default_request` | Stateless; optional `ContinuationState` round-trip |
| [Streaming WebSocket](/FastVideo/design/server_contracts/streaming) | WebSocket JSON + binary fMP4 | `GenerationRequest` per segment | Server-held `SessionStore`, snapshot-on-demand |
| [Dynamo native backend](/FastVideo/design/server_contracts/dynamo) | Dynamo RPC | `NvCreateVideoRequest` → adapter → `GenerationRequest` | Aggregated today; disaggregated via `ContinuationState` later |

All three consume the same underlying surface:

```python
from fastvideo import VideoGenerator
from fastvideo.api import (
    ContinuationState,
    GenerationRequest,
    InputConfig,
    OutputConfig,
    SamplingConfig,
    ServeConfig,
)

# Sync today, async after PR 7.10 lands VideoGenerator.generate_async.
result = generator.generate(request)
```

These docs lock down the request/response shapes so drift between
FastVideo, the internal UI, and Dynamo can be caught at review time.
PR 8 does not ship runtime code; it ships the contract reference and
the contract tests that guard it.

## Related {#related}

- [API refactor design](/FastVideo/design/overview)
- Parity inventory: [`inference_schema_parity_inventory.yaml`](/FastVideo/design/inference_schema_parity_inventory.yaml)
- [Streaming WebSocket contract](/FastVideo/design/server_contracts/streaming)
- Draft PR (closed) that establishes the Dynamo shape:
  https://github.com/ai-dynamo/dynamo/pull/7544

