Create embeddings

Creates an embedding vector representing the input text using the same interface as the OpenAI Embeddings API.
Request and response formats follow the OpenAI Create embedding API.

model is required in the request body, using the provider/model identifier format (e.g. openai/text-embedding-3-small), consistent with other AI Gateway operations.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Request body follows the OpenAI Create
embedding
API format.

Required: model, input.

Optional: dimensions, encoding_format, user.

model uses the AI Gateway provider/model identifier (e.g. openai/text-embedding-3-small)
instead of the bare OpenAI model id; all other fields match OpenAI semantics.

Request format follows OpenAI Embeddings API (create embedding).

string
required

ID of the embedding model to use.

Embedding model id in provider/model identifier
(provider prefix + model name), e.g. openai/text-embedding-3-small.

required

Input text to embed, encoded as a string or array of tokens.

To embed multiple inputs in a single request, pass an array of strings or an array of token arrays.

Constraints (OpenAI Embeddings API):

  • must not exceed the model max input tokens (8192 tokens for all embedding models)
  • cannot be an empty string
  • any array must be 2048 dimensions or less
  • all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request

Supported shapes:

  • single string
  • array of strings
  • array of token IDs (integers)
  • array of token ID arrays
integer
≥ 1

The number of dimensions the resulting output embeddings should have.

Only supported in openai/text-embedding-3 and later models.

string
enum

The format to return the embeddings in.

Allowed:
string

A unique identifier representing your end-user, which can help monitor and detect abuse.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json