openai-compat

Create Embeddings

Create embeddings using OpenAI-compatible API.

This endpoint is compatible with OpenAI's /v1/embeddings API, allowing drop-in replacement for any OpenAI SDK or client. Route-generated errors are emitted as top-level OpenAI {"error": {...}} envelopes, matching /v1/completions. The one exception is 422 request-body validation, which still returns FastAPI's HTTPValidationError {"detail": [...]} shape (out of scope for this route's error handling; known residual).

Args: request: OpenAI-format embedding request. http_request: FastAPI request (for app state). x_machine_profile: Machine profile header for routing validation.

Returns: OpenAI-format embedding response with embeddings and usage info.

post/v1/embeddings

Headers

X-SIE-MACHINE-PROFILEstring nullable

Request body

modelstring required

Model ID to use for embedding

encoding_format'float' | 'base64' nullable

Format for embeddings: 'float' or 'base64'

dimensionsinteger nullable

Requested embedding width. SIE always returns the model's native dense width, so this is accepted only when it equals that width; any other value is rejected with 400 unsupported_field rather than ignored.

userstring nullable

User ID for tracking (ignored by SIE)

Response

Embeddings generated successfully

object'list'
modelstring required

Model used

Changes