Skip to main content
Creates embeddings for text using OpenAI’s embedding models. This endpoint follows the OpenAI API specification and the requests are sent to the Azure OpenAI endpoint.

Before You Start

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Parameters

All parameters from the OpenAI Embeddings endpoint are supported according to the OpenAI specifications, with the following exceptions:
  • model: Currently only the text-embedding-ada-002 model is supported.
  • encoding_format: Supports both float and base64 formats.

Rate limits

The default limits are 500 RPM (requests per minute) and 150,000 TPM (tokens per minute).
  • RPM is enforced per workspace, model, and API key.
  • TPM is shared by all API keys using the same model in a workspace.
  • On Langdock Cloud, admins can set TPM for custom models in Settings > Workspace > Products > API; it caps the estimated size of a single request.
  • On dedicated deployments, admins can configure custom limits per model in Settings > Workspace > Products > API.
If you exceed your rate limit, you will receive a 429 Too Many Requests response.

Using OpenAI-compatible libraries

As the request and response format is the same as the OpenAI API, you can use popular libraries like the OpenAI Python library or the Vercel AI SDK to use the Langdock API.

Example using the OpenAI Python library

Example using the Vercel AI SDK in Node.js

Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.