Samples
Configure timeout
Set a custom timeout for API requests:Use custom base URL
Point to a different OpenAI-compatible API endpoint:Full configuration
Combine multiple settings:Arguments
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
base_url | TEXT | NULL | ✖ | Custom base URL for the OpenAI API |
timeout_seconds | FLOAT8 | NULL | ✖ | Timeout in seconds for API requests |
organization | TEXT | NULL | ✖ | OpenAI organization ID |
project | TEXT | NULL | ✖ | OpenAI project ID |
max_retries | INT | NULL | ✖ | Maximum number of retry attempts |
default_headers | JSONB | NULL | ✖ | Default headers to include in all requests |
default_query | JSONB | NULL | ✖ | Default query parameters for all requests |
Returns
JSONB: A configuration object that can be passed to other OpenAI functions via the client_config parameter.
Related functions
openai_embed(): use custom client config with embeddingsopenai_chat_complete(): use custom client config with chat