Skip to main content
OpenAI’s Codex ships as both a terminal CLI and a cloud-hosted agent. Paste the prompt below in either to scaffold a Lumx integration — server routes, helper, and a starter UI — with your API key kept out of the client bundle.

Prerequisites

  • A Lumx account with a Sandbox API key
  • Codex CLI installed and signed in, or access to Codex Cloud at chatgpt.com/codex
  • A project (or empty directory) where the integration should land

Step 1 — Get your Lumx credentials

From the Lumx Dashboard, open Developers → API Keys and copy a Sandbox key. See Authentication. Keys are only shown once.

Step 2 — Store the key locally

Drop the secrets into the project’s env file and keep it out of git.
.env.local
LUMX_API_KEY=lumx_sk_sandbox_xxxxxxxxxxxxxxxx
LUMX_ENV=sandbox
.gitignore (append if missing)
.env
.env.local
.env*.local
Codex (especially the cloud variant) runs in a sandbox that can read every file in the working directory. Make sure .env.local is gitignored before you commit, and never paste your key into the chat.

Step 3 — Hook up the Lumx docs MCP (CLI only)

The Codex CLI supports the Model Context Protocol. Add Lumx’s docs MCP server to ~/.codex/config.toml:
~/.codex/config.toml
[mcp_servers.lumx-docs]
url = "https://docs.lumx.io/mcp"
Restart the CLI. Codex will now pull endpoint shapes and field definitions from the Lumx docs on demand instead of guessing them.
Codex Cloud (the hosted variant) doesn’t expose MCP configuration today — it runs in an isolated container. Use the CLI when you want the agent to consult Lumx’s docs live.

Step 4 — Paste the prompt

In the Codex session, paste:
Lumx integration prompt
Add a stablecoin payments backend that uses the Lumx API. Lumx
connects local banking rails to stablecoins so I can collect, hold,
convert, and pay out money in either form.

Rules
- Read LUMX_API_KEY from environment variables (process.env in Node,
  os.environ in Python, ENV in Ruby, etc.). Never expose it in
  client-side code. Always call Lumx from server routes.
- Pick the base URL from LUMX_ENV. Default to
  https://api-sandbox.lumx.io. Use https://api.lumx.io when LUMX_ENV
  is "production".
- Send every request with the headers:
    Authorization: Bearer ${LUMX_API_KEY}
    Content-Type: application/json
- On non-2xx responses, surface the Lumx error body and HTTP status.
  Do not retry 4xx.

Before writing code
- Inspect the repo and write idiomatic code for the existing stack —
  reuse the existing router style, HTTP client, and error helper if
  one is already there. If the project is empty, ask me which stack
  before scaffolding.

Server routes to build
1. POST /api/customers — calls Lumx POST /customers. Body: type
   ("INDIVIDUAL" or "BUSINESS"), name, taxId, country (ISO-3), email.
   Returns the Lumx customer record including verification.link.
2. POST /api/on-ramp — calls Lumx POST /transactions/on-ramp. Body:
   customerId, currency (ISO-3), amount (string). Returns the
   rail-specific deposit instructions.
3. GET /api/transactions/:id — calls Lumx GET /transactions/:id and
   returns the transaction's current status and timeline.

UI to build
- Customer onboarding screen: form that calls POST /api/customers,
  then renders verification.link as a button.
- On-ramp deposit screen: form that picks a customer, sets a
  currency and amount, calls POST /api/on-ramp, then renders the
  returned deposit instructions.

After writing
- Run the app, hit each route once with curl in the terminal, and
  paste the responses back so I can confirm shape.

Reference: https://docs.lumx.io

Step 5 — Verify end to end

Codex will write the files, run the project, and (because the prompt asks for it) call each route with curl to confirm the shape. Walk the UI flow once: create a customer, open the verification link, start an on-ramp, and watch the transaction status update.

Example: a server-side Lumx helper

The prompt aims for this shape. Drop it in directly if you’d rather wire the helper by hand.
server/lumx.ts
const LUMX_BASE =
  process.env.LUMX_ENV === "production"
    ? "https://api.lumx.io"
    : "https://api-sandbox.lumx.io";

async function lumx(path: string, init?: RequestInit) {
  const res = await fetch(`${LUMX_BASE}${path}`, {
    ...init,
    headers: {
      Authorization: `Bearer ${process.env.LUMX_API_KEY}`,
      "Content-Type": "application/json",
      ...init?.headers,
    },
  });
  if (!res.ok) {
    throw new Error(`Lumx ${res.status}: ${await res.text()}`);
  }
  return res.json();
}

export const createCustomer = (input: {
  type: "INDIVIDUAL" | "BUSINESS";
  name: string;
  taxId: string;
  country: string;
  email: string;
}) => lumx("/customers", { method: "POST", body: JSON.stringify(input) });

export const createOnRamp = (input: {
  customerId: string;
  currency: string;
  amount: string;
}) =>
  lumx("/transactions/on-ramp", {
    method: "POST",
    body: JSON.stringify(input),
  });

export const getTransaction = (id: string) => lumx(`/transactions/${id}`);

FAQ

Use the CLI when you want the agent to consult Lumx’s docs MCP server live (Step 3) or when you need it to touch existing project files in place. Use Codex Cloud for fresh-repo scaffolds or longer autonomous runs in OpenAI’s sandbox — no MCP, but no local setup either.
The cloud agent sometimes inlines env values when it can read them. Pull the generated branch locally, replace any literal key with process.env.LUMX_API_KEY, and rotate the key in the Dashboard if a literal made it into a commit.
Replace LUMX_API_KEY with a Production key and set LUMX_ENV=production. Production access requires a call with the Lumx team — see Environments.
Yes. The prompt asks Codex to confirm a stack before scaffolding — answer with the framework you want (Next.js, FastAPI, Rails, etc.) and it sets up an idiomatic project.

Next steps

  • Create a customer — full reference for the customer payload
  • Webhooks — subscribe to status changes instead of polling
  • MCP server — give the Codex CLI structured access to the Lumx docs