⌘K
DocsIntegrations

OpenAI integration

Deployed AI apps work keyless out of the box — or run on your own OpenAI account.

Keyless by default: the AI gateway

Apps with the AI capability need no OpenAI account to deploy. Each deployed environment receives its own short-lived gateway token, and the app's backend sends model calls to Spaceboy's AI gateway, which forwards them to OpenAI on Spaceboy's key. Usage is metered from your organization's prepaid credits per token, and every request shows up as a line item on the Usage page — the same rail as other platform AI generation.

The gateway serves the platform's curated chat, voice, and embeddings models and enforces request-size and output caps, so a deployed app can't run arbitrary expensive models on the platform key. Sandboxes never touch the gateway at all: the assistant is simulated end to end there, with no key and no cost.

Connecting your own key

Prefer model usage billed by OpenAI to your own account? Create an API key on the OpenAI platform and paste it on the OpenAI card under Integrations (Starter plan and above). Spaceboy stores it in the encrypted secret store and keeps only the last four characters for display.

OpenAI offers no cheap way to test a credential, so the key is format-checked only — a bad key surfaces as an OpenAI error on the deployed app's first model call.

What changes

  • Deploys of projects with the AI capability inject your key server-side as OPENAI_API_KEY and stop using the gateway — redeploy an environment to pick up a newly connected key.
  • Model usage bills to your OpenAI account at OpenAI's rates; nothing is debited from your Spaceboy credits.
  • The key never reaches the browser, the app's users, or the agent's shell — it goes straight into the deployed environment's runtime configuration.
  • Use Connection defaults on the card to point different projects — or development versus production — at different keys, such as a low-limit key for development.
Billing and usage credits