OpenAI.Responses.Config (openai_responses v0.2.1)
Configuration management for the OpenAI Responses API client.
This module handles configuration options and environment variables.
Summary
Functions
Gets the API key from the configuration or environment.
Gets a value from the configuration, with an optional default.
Creates a new configuration map with the provided options.
Functions
Gets the API key from the configuration or environment.
Looks for the API key in the following places, in order:
- The
:api_key
key in the config map - The
OPENAI_API_KEY
environment variable
Parameters
config
- The configuration map
Returns
- The API key, or raises an error if not found
Gets a value from the configuration, with an optional default.
Parameters
config
- The configuration mapkey
- The key to look updefault
- The default value if the key is not found
Creates a new configuration map with the provided options.
Options
:api_key
- Your OpenAI API key (overrides environment variable):api_base
- The base URL for API requests- Other options used by the client