> For the complete documentation index, see [llms.txt](https://guides.ia.numerique.gouv.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.ia.numerique.gouv.fr/albert-api/api-reference/liste-des-endpoint/embeddings.md).

# Embeddings

## POST /v1/embeddings

> Create Embeddings

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.4.9"},"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"CreateEmbeddingsBody":{"properties":{"input":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"items":{"items":{"type":"integer"},"type":"array","minItems":1},"type":"array"},{"type":"string"},{"items":{"type":"string"},"type":"array"}],"minLength":1,"title":"Input","description":"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 array of token arrays. The input must not exceed the max input tokens for the model (call `/v1/models` endpoint to get the `max_context_length` by model) and cannot be an empty string."},"model":{"type":"string","title":"Model","description":"ID of the model to use. Call `/v1/models` endpoint to get the list of available models, only `text-embeddings-inference` model type is supported."},"dimensions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dimensions","description":"The number of dimensions the resulting output embeddings should have."},"encoding_format":{"$ref":"#/components/schemas/EncodingFormat","description":"The format of the output embeddings.","default":"float"}},"additionalProperties":true,"type":"object","required":["input","model"],"title":"CreateEmbeddingsBody"},"EncodingFormat":{"type":"string","enum":["float","base64"],"title":"EncodingFormat"},"EmbeddingsResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Embedding"},"type":"array","title":"Data"},"model":{"type":"string","title":"Model"},"object":{"type":"string","const":"list","title":"Object","default":"list"},"usage":{"$ref":"#/components/schemas/api__domain__usage__entities__Usage","description":"Usage information for the request."},"id":{"type":"string","title":"Id","description":"A unique identifier for the embedding."}},"additionalProperties":true,"type":"object","required":["data","model"],"title":"EmbeddingsResponse"},"Embedding":{"properties":{"embedding":{"items":{"type":"number"},"type":"array","title":"Embedding"},"index":{"type":"integer","title":"Index"},"object":{"type":"string","const":"embedding","title":"Object"}},"additionalProperties":true,"type":"object","required":["embedding","index","object"],"title":"Embedding","description":"Represents an embedding vector returned by embedding endpoint."},"api__domain__usage__entities__Usage":{"properties":{"prompt_tokens":{"type":"integer","title":"Prompt Tokens","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"total_tokens":{"type":"integer","title":"Total Tokens","default":0},"cost":{"type":"number","title":"Cost","default":0},"impacts":{"$ref":"#/components/schemas/api__domain__usage__entities__EnvironmentalImpacts","default":{"kWh":0,"kgCO2eq":0}}},"additionalProperties":true,"type":"object","title":"Usage"},"api__domain__usage__entities__EnvironmentalImpacts":{"properties":{"kWh":{"type":"number","title":"Kwh","default":0},"kgCO2eq":{"type":"number","title":"Kgco2Eq","default":0}},"additionalProperties":true,"type":"object","title":"EnvironmentalImpacts"},"api__infrastructure__fastapi__documentation__HTTPExceptionModel":{"properties":{"status_code":{"type":"integer","title":"Status Code"},"detail":{"type":"string","title":"Detail"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"}},"type":"object","required":["status_code","detail"],"title":"HTTPExceptionModel"}}},"paths":{"/v1/embeddings":{"post":{"tags":["Embeddings"],"summary":"Create Embeddings","operationId":"create_embeddings_v1_embeddings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmbeddingsBody","description":"The embeddings creation request."}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsResponse"}}}},"400":{"description":"Insufficient budget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"401":{"description":"Invalid authentication scheme.<br>Invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"403":{"description":"Your account has expired. Please contact support to renew your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"404":{"description":"Model {name} not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"422":{"description":"Model has wrong type. Expected: {expected_type}. Actual: {actual_type}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"429":{"description":"Token/request limit per minute/day exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"503":{"description":"Model is too busy, please try again later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}}}}}}}
```


---

# 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://guides.ia.numerique.gouv.fr/albert-api/api-reference/liste-des-endpoint/embeddings.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.
