Create embeddings
embedding returns openai.types.CreateEmbeddingResponse. Any OpenAI-compatible embeddings endpoint works, such as Gemini, Mistral or a local Ollama server:
aembedding is the async form and takes the same arguments.
Anthropic has no embeddings API, so
embedding with a Claude model raises BadRequestError.Call the Responses API
responses sends a request to the OpenAI Responses API and returns the SDK’s own Response object, or its event stream when you pass stream=True:
completion, such as api_key, api_base, num_retries, drop_params and client, alongside any Responses API parameter. aresponses is the async form.
Errors are mapped to the same typed exceptions as completion. See Error handling.
responses does not support mock_response. Use a provider that implements the OpenAI Responses API, such as OpenAI.