Create embeddings
POST
/v1/embeddingsTurn text into embedding vectors with the OpenAI Embeddings format. Only models whose catalog entry lists /v1/embeddings are supported here.
Authorization
bearerAuth AuthorizationBearer <token>
Your API key from the console: Authorization: Bearer sk-...
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
model*string
An embedding model ID from List models.
input*string|array<string>
encoding_format?string
Default
"float"Value in
- "float"
- "base64"
dimensions?integer
Range
1 <= valueResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/embeddings" \ -H "Content-Type: application/json" \ -d '{ "model": "<model-id>", "input": "The quick brown fox" }'{ "object": "list", "model": "string", "data": [ { "object": "embedding", "index": 0, "embedding": [ 0 ] } ], "usage": { "prompt_tokens": 0, "total_tokens": 0 }}