OpenAI is the integration named
openai on the wire (integration_type: "llm_provider"). It exposes one auth schema — api_key — so there is no ModuleX-managed (pooled-key) option for OpenAI. For credit-metered managed models, use ModuleX-managed models instead.Before you start
An OpenAI API key
Create a secret key at the OpenAI API keys page. It starts with
sk- (for example sk-proj-…). ModuleX validates it against the format ^sk-[a-zA-Z0-9\-_]{20,}$.Owner or admin role
Creating and managing credentials and browsing the integration catalog require the owner or admin role in your organization. The retired
member role cannot perform these actions. See Roles & permissions.Your auth headers
Every API call sends
Authorization: Bearer mx_live_… and X-Organization-ID. See Authentication.An OpenAI billing account
BYOK usage is charged by OpenAI to your OpenAI account, not by ModuleX. Make sure your OpenAI account has billing enabled and sufficient quota.
Connect OpenAI
You connect OpenAI by creating anapi_key credential for the openai integration. ModuleX auto-detects the credential type from the body you send: an auth_data object containing api_key is stored as an api_key credential.
Get your OpenAI API key
In the OpenAI dashboard, go to API keys, choose Create new secret key, name it, set its permissions, and copy the value. You only see it once — store it securely until you paste it into ModuleX.
(Optional) validate it before saving
Call
POST /credentials/test-temporary to check the key works before persisting it. ModuleX runs OpenAI’s configured test — a minimal POST https://api.openai.com/v1/chat/completions with gpt-5.4-mini and max_tokens: 10 — and reports is_valid.Create the credential
Call
POST /credentials with integration_name: "openai" and auth_data.api_key. Set make_default: true to make it the default OpenAI credential for the organization. ModuleX encrypts the key at rest and never returns it in clear text.Select OpenAI models
The key is now resolvable for any surface that runs an OpenAI model — workflows, the Assistant, the Composer, and chat. See Select an OpenAI model.
🎬 MEDIA PLACEHOLDER · MX-MEDIA-4060 · [SCREENSHOT]
[SCREENSHOT_DESCRIPTION]: The ModuleX app credential dialog for connecting OpenAI with an API key.
[SCREENSHOT_DETAILS]: Capture the “Connect OpenAI” credential form in the integrations/credentials area of the ModuleX app. Show the OpenAI logo, the API Key field (masked, placeholder
sk-proj-…), the optional Base URL field defaulting to https://api.openai.com/v1, the “Set as default” toggle, and the Test/Save buttons. Light theme, 16:9, crop to the dialog.Create the credential
POST /credentials returns 201. The type is auto-detected from the body — passing auth_data.api_key yields an api_key credential. See the full credentials reference in Credentials & OAuth2.
Must be
openai.The secret material. For OpenAI,
{"api_key": "sk-proj-…"}. The presence of api_key selects the api_key auth type. To target an OpenAI-compatible endpoint, also include base_url (see OpenAI-compatible endpoints).A human-readable label. Defaults to the integration’s display name (
OpenAI) when omitted.Set this credential as the default OpenAI credential for the organization. Only one credential per integration can be the default.
Optional ISO-8601 datetime after which ModuleX treats the credential as expired.
201 Created (secret masked):
The credential’s UUID. Pass this as
credential_id to pin a specific OpenAI key on a run.openai.llm_provider.api_key.Whether this is the organization’s default OpenAI credential.
ISO-8601 timestamp of the last resolution, or
null if never used.Validate a key before saving
POST /credentials/test-temporary validates auth data before you persist it. ModuleX runs OpenAI’s configured test endpoint (POST https://api.openai.com/v1/chat/completions, model gpt-5.4-mini, max_tokens: 10) and treats HTTP 200 with id, choices, and model present as success.
openai.api_key.{"api_key": "sk-proj-…"}. Optionally include base_url.is_valid, a human-readable message, tested_at, and a test_method of api_call.
OpenAI-compatible endpoints
OpenAI’s auth schema includes an optionalbase_url field, so you can point the same credential at any OpenAI-compatible API (a proxy, gateway, or self-hosted server that speaks the OpenAI wire protocol).
The API base URL. Only change this for an OpenAI-compatible endpoint. ModuleX validates it against
^https?://.*.base_url inside auth_data when you create the credential. Leave it unset to use OpenAI directly.
cURL
Available models
ModuleX serves OpenAI’s models from its integration catalog. The list below is the catalog as shipped in the backend OpenAI manifest; OpenAI updates models over time, so always treat the live catalog (browse it via the API) as authoritative. Each model carries a standardizedid (the value you pass as model_id), pricing in USD per 1M tokens (input and output), a context window (max_input_tokens), an output cap (max_output_tokens), a knowledge cutoff (data_freshness), intelligence and speed scores (1–5), and vision support. Pricing shown is OpenAI’s list price that ModuleX records for analytics — your actual charge comes from OpenAI, not ModuleX.
Chat and reasoning models
model_id | Display name | Context (in) | Max output | Input $/1M | Output $/1M | Vision | Cutoff |
|---|---|---|---|---|---|---|---|
gpt-5.5 | GPT 5.5 | 1,050,000 | 128,000 | $5.00 | $30.00 | Yes | 2025-12-01 |
gpt-5.5-pro | GPT 5.5 Pro | 1,050,000 | 128,000 | $30.00 | $180.00 | Yes | 2025-12-01 |
gpt-5.4 | GPT 5.4 | 1,050,000 | 128,000 | $2.50 | $15.00 | Yes | 2025-08-31 |
gpt-5.4-pro | GPT 5.4 Pro | 1,050,000 | 128,000 | $30.00 | $180.00 | Yes | 2025-08-31 |
gpt-5.4-mini | GPT 5.4 mini | 400,000 | 128,000 | $0.75 | $4.50 | Yes | 2024-05-31 |
gpt-5.4-nano | GPT 5 nano | 400,000 | 128,000 | $0.20 | $1.25 | Yes | 2024-08-31 |
gpt-5-chat-latest | GPT 5 chat latest | 128,000 | 16,384 | $1.25 | $10.00 | Yes | 2024-09-30 |
gpt-5.3-codex | GPT 5.3 codex | 400,000 | 128,000 | $1.75 | $14.00 | Yes | 2025-08-31 |
o3-pro | o3-pro | 200,000 | 100,000 | $20.00 | $80.00 | Yes | 2024-06-01 |
o3 | o3 | 200,000 | 100,000 | $2.00 | $8.00 | Yes | 2024-06-01 |
Embedding models
Embedding models return a vector instead of text (max_output_tokens is 0). Use them to build a knowledge base with OpenAI embeddings, or in a workflow that needs vectors.
model_id | Display name | Dimensions | Max input | Input $/1M | Output $/1M |
|---|---|---|---|---|---|
text-embedding-3-large | Text Embedding 3 Large | 3072 | 8,191 | $0.13 | $0.00 |
text-embedding-3-small | Text Embedding 3 Small | 1536 | 8,191 | $0.02 | $0.00 |
text-embedding-3-small produces 1536-dimensional vectors, which match ModuleX’s managed vector storage column width. text-embedding-3-large produces 3072-dimensional vectors. Pick the embedding model that matches your vector store’s dimension when you configure a knowledge base. See Managed knowledge and Knowledge & RAG.Select an OpenAI model
Across the API and SDKs, you choose a model with anllm configuration object. For OpenAI, every field uses the openai slug:
openai.openai.A catalog model id from Available models, for example
gpt-5.5.The id of the OpenAI credential to use. Omit it to let ModuleX resolve a credential: your
is_default OpenAI credential, then the most-recent valid one. ModuleX prefers your own keys over managed keys — and OpenAI is BYOK-only, so resolution always lands on a key you connected.llm field:
llm config
- In a workflow (LLM node)
- In the Assistant
- In the AI Composer
- In chat
In the LLM node (and the Agent node), set the node’s
llm_config to an OpenAI model. ModuleX resolves the standardized model_id to OpenAI’s wire model via the catalog’s body_extra.model, then calls OpenAI with your resolved credential. See Workflow engine & nodes.Deprecation routing applies only to managed models. For managed integrations (
modulexai), a model marked deprecated routes to its replacement_id automatically, and unknown ids fall back to the integration default. OpenAI is BYOK (a passthrough integration), so its model_id is used as-is — an unknown id is sent straight to OpenAI and fails there. None of the OpenAI catalog models are currently marked deprecated.Browse OpenAI in the catalog
The integration catalog is the read-only discovery surface. Use it to fetch OpenAI’s live models, pricing, and auth schema. These catalog endpoints authenticate with a Clerk JWT (the app token), not anmx_live_* API key, and still require X-Organization-ID and the owner/admin role.
openai.200 OK, an IntegrationDetail:
openai.OpenAI.llm_provider.The OpenAI model list described in Available models.
The OpenAI auth schemas. OpenAI ships a single
api_key schema with setup_instructions, the api_key and base_url setup_environment_variables, and a test_endpoint.https://platform.openai.com/docs.The integration’s
extra_metadata (status, recommended, timestamps, popularity score).BYOK billing
OpenAI is bring-your-own-key. Usage on your OpenAI credential is billed by OpenAI to your OpenAI account and is not metered in ModuleX credits.No ModuleX credit charge
BYOK calls — OpenAI included — carry no ModuleX credit gate. There is no markup, and these calls do not draw down your plan allowance or wallet.
No billing-gate denials
Because there is no credit gate on BYOK calls, OpenAI usage does not produce the
402/403/429 DenialEnvelope that managed usage can. See Usage gating & limits.Billed by OpenAI
Token costs accrue on your OpenAI account at OpenAI’s rates. Set spend limits and monitor usage in the OpenAI dashboard.
Analytics only
ModuleX records token counts and the catalog list price for OpenAI usage for analytics, so you can see consumption per workflow or run — but no credits are deducted.
Want credit-metered, no-key-required models instead? Use ModuleX-managed models (the
modulexai provider), which run on ModuleX-provisioned keys and bill in credits — gated by your plan. There is no managed (pooled-key) path for openai; OpenAI is always BYOK. See Credits & metering.Rate limits, quotas, and model availability for BYOK calls are governed by your OpenAI account, not by ModuleX. A
429 or quota error from OpenAI surfaces as an upstream error on the run, distinct from ModuleX’s own rate limiting.Managing the credential
Day-to-day operations use the standard credentials API. For OpenAI specifically:- Rotate a key. Secrets are immutable through
PUT /credentials/{id}(that route updates onlydisplay_nameand metadata). To rotate, create a new OpenAI credential with the new key and delete the old one — there is no rotate endpoint. - Set the default.
POST /credentials/{id}/set-defaultmakes one OpenAI credential the organization default, used when nocredential_idis supplied. - Test a saved key.
POST /credentials/{id}/testre-runs OpenAI’s test endpoint against the stored key. - Delete.
DELETE /credentials/{id}removes it and returns204. Runs that relied on it will fail credential resolution until another valid OpenAI credential exists.
Where to go next
LLM providers
Compare OpenAI with the other model providers, managed and BYOK.
ModuleX-managed models
The credit-metered, no-key-required default provider.
Credentials & OAuth2
The full credential model, resolution precedence, and credentials API.
LLM node
Call an OpenAI model from a workflow with prompts, variables, and structured output.