ModuleX-managed (modulexai)
ModuleX provisions the upstream provider keys for you. Usage is metered in credits against your plan allowance and wallet. No provider account or key required.
Bring your own key (BYOK)
You supply your own provider API key. Usage is billed directly by the provider with no ModuleX markup, and is not charged in ModuleX credits (analytics-only).
🎬 MEDIA PLACEHOLDER · MX-MEDIA-4050 · [IMAGE]
[IMAGE_DESCRIPTION]: Diagram of the two connection paths for an LLM provider.
[IMAGE_DETAILS]: Show a single “LLM provider” box fanning into two lanes — “ModuleX-managed (modulexai, modulex_key auth)” routed through ModuleX-provisioned keys and metered in credits, and “BYOK (api_key auth)” routed directly to the upstream vendor and billed by the vendor. Label which lane consumes credits. 16:9, light and dark variants, ModuleX brand palette, no UI chrome.
Supported providers
The catalog ships these LLM providers. The wire name is the value you send asintegration_name when you create a credential or pick a model.
| Provider | Wire name | Connect with | Billing | Page |
|---|---|---|---|---|
| ModuleX-managed | modulexai | modulex_key (no key needed) | Credits | ModuleX-managed models |
| OpenAI | openai | api_key (BYOK) | Provider-direct | OpenAI |
| Anthropic | anthropic | api_key (BYOK) | Provider-direct | Anthropic |
| Google Gemini | gemini | api_key (BYOK) | Provider-direct | Google Gemini |
| xAI Grok | xai | api_key (BYOK) | Provider-direct | xAI Grok |
Two further providers exist on the wire but are routing layers, not separately documented destinations.
openrouter is a BYOK aggregator used internally to route many of the managed models, and bedrock carries only deprecated model ids that route to their replacements. Connect modulexai for managed access or a first-party provider above for BYOK; you do not need to connect openrouter or bedrock directly. See Selecting a model for how deprecated ids are handled, and the open questions below.GET /integrations/llm-providers/{provider_name}). It carries the provider’s models[] and its auth_schemas[]; it never returns or stores your secret key.
Managed vs BYOK
The two modes differ in authentication, billing, and what you have to supply.- ModuleX-managed (modulexai)
- Bring your own key (BYOK)
- Wire name:
modulexai. - Auth schema:
modulex_key. ModuleX provides the upstream key automatically —setup_environment_variablesis empty, so there is nothing for you to enter. - Billing: credited. Every managed turn is metered (see Credit cost) and flows through the billing admission gate, which can return a
DenialEnvelopeon402/403/429when your allowance and wallet are exhausted. - Use it when you want one provider with no key management, curated models, and unified usage tracking. It is the default and recommended provider.
- Models are curated and may be routed across upstreams (for example, several
modulexaimodels route through OpenRouter with a Bedrock-then-Anthropic fallback order). You select by ModuleXmodel_id; the routing is handled for you.
Connecting a provider
Managed access needs no setup —modulexai is available out of the box and requires no credential. For BYOK, you create a credential that stores your provider key (encrypted at rest), in the app or over the API.
In the app
Open the integration's connect screen
Open the integration catalog, find the provider (for example, OpenAI), and choose to connect it. You must be an owner or admin of the organization.
Enter your provider key
Paste the provider API key into the field defined by the provider’s
api_key auth schema. Some providers also accept an optional Base URL for compatible endpoints.🎬 MEDIA PLACEHOLDER · MX-MEDIA-4051 · [SCREENSHOT]
[SCREENSHOT_DESCRIPTION]: The connect-credential dialog for a BYOK LLM provider.
[SCREENSHOT_DETAILS]: Capture the OpenAI provider connect modal showing the API Key field (masked), the optional Base URL field, and the validate/save action. Use a placeholder key value, never a real secret. Light theme, cropped to the dialog.
Over the API
Create the credential withPOST /credentials. The request body is read raw and the auth type is auto-detected from the body — sending auth_data.api_key creates an api_key credential. Authenticate every request per Authentication: Authorization: Bearer mx_live_… plus X-Organization-ID.
The provider wire name —
openai, anthropic, gemini, or xai. Use modulexai only for managed access, which needs no key.The secret payload. For a BYOK provider, include
api_key. The presence of auth_data.api_key is what selects the api_key credential type.A human-readable label for the credential, shown in the app and credential list.
When
true, this credential becomes the default for the integration; any prior default for the same integration is unset.The SDK method names and shapes above follow the documented credential surface. Confirm the exact SDK method path against the SDK ⇄ API parity matrix; where an SDK lacks a method, call
POST /credentials directly with cURL.201 with the credential record. To check a key before saving it, use POST /credentials/test-temporary with integration_name, auth_type: "api_key", and auth_data; it runs the provider’s validation endpoint and returns is_valid. For rotation, scoping, and listing, see Managing credentials.
Errors
| Status | Shape | When |
|---|---|---|
400 | {detail} | auth_data/auth_type could not be resolved to a known credential type, or validation failed. |
401 | {detail} | Missing or invalid Authorization, or missing X-Organization-ID. |
403 | {detail} | You are not an owner or admin of the organization. |
500 | {detail} | Unexpected server error while creating the credential. |
{detail} HTTPException envelope (a string message). The flat DenialEnvelope billing shape ({code, layer, key, current, limit, reason}) appears only on managed-usage surfaces — the run, Composer, Assistant, and managed-knowledge calls that actually meter credits — not on credential CRUD. See Errors & status codes for all three envelope shapes.
Selecting a model
A provider exposes its models in amodels[] array. You select a model by its ModuleX model_id (for example, claude-sonnet-4.6), and ModuleX resolves that to the upstream wire model and request shape for you.
The model record
Each entry inmodels[] carries the fields below. Values come from the provider’s catalog record; pricing fields apply to BYOK provider-direct billing and inform managed credit metering.
The ModuleX
model_id you select (for example, claude-opus-4.7, gpt-5.5, gemini-2.5-pro).Human-readable model name shown in selectors.
Display vendor, for example
Anthropic or OpenAI.Routing provider slug —
anthropic, openai, gemini, xai, or openrouter for models routed through the aggregator under modulexai.Maximum context window in tokens.
Maximum tokens the model can generate.
0 for embedding models.Knowledge-cutoff date (for example,
2026-01-01). This field, not a knowledge_cutoff key, carries the cutoff.Quality score, 1–5.
Latency score, 1–5 (higher is faster).
Whether the model accepts image input.
Input price per 1M tokens, as a flat number (not a nested
pricing object).Output price per 1M tokens.
Present on some models — whether the model supports tool/function calling.
Present on some models — whether JSON-schema structured output is supported.
true for embedding models. Embedding models report embedding_dimension and a zero output price.Vector dimension for embedding models (for example,
3072 for text-embedding-3-large).Lifecycle state. Present and set to
deprecated on retired model ids.On a deprecated model, the successor
model_id that ModuleX routes the call to instead.Where you select a model
- Chat — pick the model in the chat composer. See Model selection.
- Assistant — set the model in Assistant settings. See Models & settings.
- LLM node — set
model_idon the node. See LLM node. - Agent node — set
model_idon the node. See Agent node.
Deprecated models route automatically
When you select a model whosestatus is deprecated (or maintenance), ModuleX resolves it to its replacement_id before the call — for example, a bedrock-claude-sonnet-4.6 id routes to claude-sonnet-4.6. Routing is cycle- and depth-guarded, so a chain of replacements terminates at a live model. You do not need to update saved selections immediately, but prefer the live id for clarity.
Credit cost for managed usage
BYOK calls are not credited. Managed (modulexai) calls are metered two ways and charged against your credits:
- Per-turn run charge — each logical run or chat turn is charged a flat
RUN_CREDITof 1 credit. - Token metering — the model’s tokens are converted to credits:
Token-to-credit formula
input_rate/output_rate are the model’s input_usd_per_1m_tokens / output_usd_per_1m_tokens, MARGIN is 1.05 (a 5% system margin), and SCALE is 1000 (so **1000 credits = 0.001). Embedding calls force completion_tokens = 0. An unknown model meters to 0, never a silent fallback rate.
When managed usage exhausts your plan allowance and wallet, the call is denied with a DenialEnvelope on 402 / 403 / 429. See Credits & metering and Usage gating & limits for the full model.
Permissions and access
Connecting, listing, and managing LLM-provider credentials requires the owner or admin role in the organization (member is retired). Every request also needs the org context header X-Organization-ID; a missing header is rejected. See Roles & permissions and Org context & X-Organization-ID.
Per-provider pages
ModuleX-managed models
The default managed provider (
modulexai), billed in credits — no key required.OpenAI
Connect your OpenAI account (BYOK) and use GPT models.
Anthropic
Connect your Anthropic account (BYOK) and use Claude models.
Google Gemini
Connect your Google account (BYOK) and use Gemini models.
xAI Grok
Connect your xAI account (BYOK) and use Grok models.
Related
- Authentication & credentials — the auth-schema variants and OAuth2 flow for integrations.
- Managing credentials — create, rotate, scope, and test credentials.
- Knowledge providers — the vector-store side of managed vs BYOK.
- Credits & metering — what consumes credits and how it is measured.
Open questions (TBD)
- OpenRouter and Bedrock pages. Both names exist on the wire (
openrouteras the BYOK aggregator behind several managed models;bedrockcarrying only deprecated, replacement-routed ids), but neither has a canonical documentation page in the current information architecture. Whether to document them as standalone connectable providers is TBD pending a product decision. - Public catalog base URL. The provider catalog and credential examples use
https://api.modulex.devper the repo-wide convention; the exact public host for these endpoints is not pinned from source and should be confirmed against the deployed environment.