> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/api-reference/ai/ai-model-hub/open-ai-compatible-endpoints/creates-an-embedding-vector.md).

# Creates an embedding vector.

Creates an embedding vector representing the input. Supports both text-only embeddings (via `input`) and multimodal embeddings (via `messages`) for compatible models. Provide either `input` or `messages`, not both.

```json
{"openapi":"3.0.3","info":{"title":"IONOS CLOUD - OpenAI compatible AI Model Hub API","version":"1.0.0"},"tags":[{"name":"OpenAI Compatible Endpoints","description":"Endpoints compatible with OpenAI's API specification"}],"servers":[{"url":"https://openai.inference.de-txl.ionos.com","description":"Berlin"}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Please provide header value as 'Bearer <token>' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token."}},"schemas":{"EmbeddingRequest":{"type":"object","properties":{"model":{"type":"string","description":"ID of the model to use. Please check /v1/models for available models"},"input":{"oneOf":[{"type":"string","description":"The input text to create an embedding for (single string)"},{"type":"array","description":"The input text to create embeddings for (list of strings)","items":{"type":"string"}}],"description":"Text input for text-only embedding models. Mutually exclusive with messages.\n"},"messages":{"type":"array","description":"Chat-style messages for multimodal embedding models (vLLM extension). Supports the same format as chat completions, enabling multimodal inputs (text, images) to be passed to embedding models. Mutually exclusive with input.\n","items":{"$ref":"#/components/schemas/ChatCompletionMessage"}}},"required":["model"],"oneOf":[{"type":"object","required":["input"],"not":{"type":"object","required":["messages"]}},{"type":"object","required":["messages"],"not":{"type":"object","required":["input"]}}]},"ChatCompletionMessage":{"type":"object","description":"A message in a chat completion request, supporting both text-only and multimodal content","properties":{"role":{"type":"string","description":"The role of the message's author","enum":["system","user","assistant","tool"]},"content":{"oneOf":[{"type":"string","description":"Text content of the message (legacy format)"},{"type":"array","description":"Array of content parts for multimodal messages","items":{"$ref":"#/components/schemas/ChatCompletionContentPart"}}]},"name":{"type":"string","description":"The name of the author of the message"},"tool_calls":{"type":"array","description":"Tool calls generated by the model","items":{"$ref":"#/components/schemas/chatCompletionMessageToolCall"}},"tool_call_id":{"type":"string","description":"Tool call that this message is responding to"}},"required":["role","content"]},"ChatCompletionContentPart":{"oneOf":[{"$ref":"#/components/schemas/ChatCompletionContentPartText"},{"$ref":"#/components/schemas/ChatCompletionContentPartImage"}],"discriminator":{"propertyName":"type","mapping":{"text":"#/components/schemas/ChatCompletionContentPartText","image_url":"#/components/schemas/ChatCompletionContentPartImage"}}},"ChatCompletionContentPartText":{"type":"object","description":"Text content part","properties":{"type":{"type":"string","enum":["text"],"description":"The type of the content part"},"text":{"type":"string","description":"The text content"}},"required":["type","text"]},"ChatCompletionContentPartImage":{"type":"object","description":"Image content part","properties":{"type":{"type":"string","enum":["image_url"],"description":"The type of the content part"},"image_url":{"$ref":"#/components/schemas/ChatCompletionContentPartImageImageUrl"}},"required":["type","image_url"]},"ChatCompletionContentPartImageImageUrl":{"type":"object","description":"Image URL or data","properties":{"url":{"type":"string","description":"Either a URL of the image or the base64 encoded image data.\nSupported formats:\n- URLs: https://example.com/image.jpg\n- Base64 data URLs: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...\n"},"detail":{"type":"string","description":"Specifies the detail level of the image. \n- \"low\" uses fewer tokens and is faster\n- \"high\" is more detailed but uses more tokens\n- \"auto\" lets the model choose\n","enum":["low","high","auto"],"default":"auto"}},"required":["url"]},"chatCompletionMessageToolCall":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the tool call."},"type":{"$ref":"#/components/schemas/toolCallType"},"function":{"type":"object","description":"The function that the model called.","properties":{"name":{"type":"string","description":"The name of the function to call."},"arguments":{"type":"string","description":"The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."}},"required":["name","arguments"]}},"required":["id","type","function"]},"toolCallType":{"type":"string","enum":["function"],"description":"The type of the tool call, in this case `function`."},"EmbeddingResponse":{"type":"object","properties":{"model":{"type":"string","description":"ID of the model used"},"object":{"type":"string","description":"The object used to generate the embeddings"},"data":{"type":"array","description":"The list of generated embeddings","items":{"$ref":"#/components/schemas/Embedding"}},"usage":{"$ref":"#/components/schemas/EmbeddingUsage"}}},"Embedding":{"type":"object","properties":{"index":{"type":"integer","description":"The index of the input text"},"object":{"type":"string","description":"The object used to generate the embeddings"},"embedding":{"type":"array","description":"The embedding vector","items":{"type":"number","format":"float"}}}},"EmbeddingUsage":{"type":"object","properties":{"prompt_tokens":{"type":"integer","description":"The number of tokens in the input text"},"total_tokens":{"type":"integer","description":"The total number of tokens used"}}},"ErrorResponse":{"type":"object","description":"OpenAI-compatible error response. Returned for error responses that define this schema (for example, 429 Too Many Requests). Note: the backend currently returns an IONOS-native error body format; alignment to this schema is tracked in GPHML-2078.\n","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error description."},"type":{"type":"string","description":"Error category (e.g. \"requests\", \"invalid_request_error\")."},"code":{"type":"string","nullable":true,"description":"Machine-readable error code (e.g. \"rate_limit_exceeded\"). May be null or omitted."},"param":{"type":"string","nullable":true,"description":"Parameter related to the error, if applicable. May be null or omitted."}},"required":["message","type"]}},"required":["error"]}},"headers":{"X-RateLimit-Limit":{"description":"Sustained request rate limit expressed as requests per minute. Enforcement is per second — see X-RateLimit-Burst for the short-window limit. The actual value depends on your contract; the default is 300 req/min (5 req/s).\n","schema":{"type":"integer"}},"X-RateLimit-Burst":{"description":"Maximum number of requests allowed within a 2-second burst window. Exceeding this triggers a 429 response. The actual value depends on your contract; the default is 10 requests per burst window.\n","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current 2-second burst window. Resets when the burst window expires. Does not reflect the per-minute X-RateLimit-Limit.\n","schema":{"type":"integer"}}},"responses":{"TooManyRequests":{"description":"Rate limit exceeded. Retry after the number of seconds indicated by the Retry-After header. Limits are contract-specific; check X-RateLimit-Limit and X-RateLimit-Burst in the response headers for the values that apply to your contract.\n","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Burst":{"$ref":"#/components/headers/X-RateLimit-Burst"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Overloaded":{"description":"The platform is temporarily overloaded and is shedding load to stay stable. Retry after the number of seconds indicated by the Retry-After header. This is unrelated to your contract's rate limits.\n","headers":{"Retry-After":{"description":"Number of seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v1/embeddings":{"post":{"operationId":"openaiCompatEmbeddingsPost","summary":"Creates an embedding vector.","description":"Creates an embedding vector representing the input.\nSupports both text-only embeddings (via `input`) and multimodal embeddings (via `messages`)\nfor compatible models. Provide either `input` or `messages`, not both.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequest"}}}},"responses":{"200":{"description":"Successful operation","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Burst":{"$ref":"#/components/headers/X-RateLimit-Burst"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingResponse"}}}},"400":{"description":"Bad request"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"description":"Server error"},"529":{"$ref":"#/components/responses/Overloaded"}},"tags":["OpenAI Compatible Endpoints"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/api-reference/ai/ai-model-hub/open-ai-compatible-endpoints/creates-an-embedding-vector.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
