OpenAI Embeddings
Creates embeddings for text using OpenAI’s embedding models
Documentation Index
Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
Use this file to discover all available pages before exploring further.
api.langdock.com with your deployment’s base URL: <deployment-url>/api/publicmodel: Currently only thetext-embedding-ada-002model is supported.encoding_format: Supports bothfloatandbase64formats.
Rate limits
The rate limit for the Embeddings endpoint is 500 RPM (requests per minute) and 60,000 TPM (tokens per minute). Rate limits are defined at the workspace level - and not at an API key level. If you exceed your rate limit, you will receive a429 Too Many Requests response.
Please note that the rate limits are subject to change, refer to this documentation for the most up-to-date information.
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
Authorizations
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Path Parameters
The region of the API to use.
eu, us Body
Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of tokens, e.g. ["text1", "text2"]. Each input must not exceed 8192 tokens in length.
ID of the model to use. You can use the List models API to see all of your available models, or see OpenAI's Model overview for descriptions of them.
The format to return the embeddings in. Can be either float or base64.
float, base64 The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.
x >= 1A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.