AI service
OpenAI
The OpenAI integration connects your project to the OpenAI API — with a shared, Dreambase-managed key or a dedicated key you provide — exposes the connection details as outputs, and offers chat completions, embeddings, and model listing via function calls, plus health checks and metrics.
OpenAI is one of the AI service integrations. It handles its own webhook route:
/openai/webhookWhat it does
On DEPLOYMENT_CREATED the service resolves the key (shared or dedicated), verifies it against the OpenAI /models endpoint, and publishes the connection details — apiKey, models, and apiUrl — back to Dreambase as outputs for other services to consume. The deployment connects to the provider API; there is no infrastructure to provision.
Instance type
- shared (default) — use the Dreambase-managed OpenAI key (
OPENAI_SHARED_API_KEY). Ideal for MVPs and development, with no setup required. - dedicated — bring your own OpenAI API key, with an optional organization ID.
Choosing models
Themodels input is a comma-separated list of the model IDs you want to work with (e.g. gpt-4o, gpt-4o-mini). The first one is used as the default when a function call doesn't name a model. Configured models that the key can't see are logged as a warning at configure time, but don't fail the connection.Inputs
| Input | Applies to | Description |
|---|---|---|
serverType | all | Either shared (default) or dedicated. |
apiKey | dedicated | Your OpenAI API key. Accepts a {{env.KEY}} reference. |
organizationId | dedicated | Optional. Sent as the OpenAI-Organization header. |
baseUrl | all | Optional. Target Azure OpenAI or an OpenAI-compatible gateway (default https://api.openai.com/v1). |
models | all | Comma-separated model IDs to work with. The first is the default. |
Outputs
apiKey— the resolved OpenAI API key.models— the comma-separated list of configured model IDs.apiUrl— the base URL used for API requests.organizationId— the OpenAI organization ID, when provided.
Functions
Callable via a FUNCTION_CALL event:
listModels— list the model IDs available to the key.chatCompletion— generate a chat completion. Provide either a fullmessagesarray or a simpleprompt(with an optionalsystemmessage), plus optionalmodel,maxTokens, andtemperature. Returns the messagecontent,model, andusage.createEmbedding— embed a string or array of strings with a givenmodel. Returns theembeddingsarray.
Metrics
On METRIC_UPDATE the service reports available_models (the number of models the key can access) and configured_models (the number selected for this service).
Events it handles
WEBHOOK_CHALLENGE— verify the webhook endpoint.HEALTH_CHECK— probe the OpenAI/modelsendpoint with the configured key.METRIC_UPDATE— report available and configured model counts.DEPLOYMENT_CREATED— verify the key and publish the connection details as outputs.DEPLOYMENT_DELETED— stop tracking the connection (nothing external is torn down).FUNCTION_CALL— run a named function.