Easiest path: swap the base URL
Most AI nodes accept an OpenAI‑compatible endpoint. Set:- Base URL:
https://api.openstack.ai/v1 - API Key: your OpenStack API key (server/secret credential)
- Model: keep the same model id (e.g.,
openai/gpt-4o-mini) or choose from your configured models - User: provide a stable id if the node supports it (body
useror a header field)
n8n (Agents / OpenAI nodes)
- Open the AI node (e.g., Agent, Chat Model, OpenAI node).
- Provider: OpenAI (or OpenAI‑compatible).
- Advanced/Custom host: set Base URL to
https://api.openstack.ai/v1. - API Key: set a credential holding your OpenStack key.
- Model: select your desired model (e.g.,
openai/gpt-4o-mini). - Optional: add a stable
userfield if supported to enable per‑user metering.
Zapier (AI Actions / AI by Zapier)
- In an AI step that supports an OpenAI‑compatible provider, set Base URL to
https://api.openstack.ai/v1. - Use your OpenStack API key as the credential.
- Keep the rest of your prompt/chain as‑is.
Alternative: Custom HTTP request (when needed)
If your tool or step doesn’t expose model settings, call the Chat Completions API directly.- URL:
POST https://api.openstack.ai/v1/chat/completions - Headers:
Authorization: Bearer <OPENSTACK_API_KEY>,Content-Type: application/json - Optional:
X-Openstack-User: <user_id>if you can’t putuserin the body - Body:
{ model, user, messages, stream? }
Advanced: custom payments and manual charges
For more complex flows (your own checkout, per‑tool fees, post‑processing charges), call these endpoints directly from your no‑code tool:- Deposit credits (credit a user after your checkout succeeds):
POST https://api.openstack.ai/v1/user/balance/deposit - Charge user (manual one‑off debit for actions outside token metering):
POST https://api.openstack.ai/v1/user/charge
Authorization: Bearer <OPENSTACK_API_KEY>Content-Type: application/jsonIdempotency-Key: <stable-request-id>(strongly recommended)
user: stable pseudonymous user idamount: string value in your configured currency (e.g., “1.50”)metadata: optional JSON with your payment reference (payment_intent,checkout_session, internal ids)
- Method: POST
- URL: one of the endpoints above
- Data: JSON with
user,amount,metadata - Headers: add the three headers listed above
- Method: POST
- URL: one of the endpoints above
- Send: JSON
- Body:
user,amount, optionalmetadata - Headers: add the three headers listed above
- Default mode: use Deposit after your own payment succeeds; makes the balance available for future usage charges.
POST /user/chargemay returnsuccess: falsewith an assistant message containing an authorization or top‑up link—forward that message to your user.- Always reuse the same Idempotency‑Key when retrying to prevent duplicate deposits/charges.
- Deposit:
api-reference/user/balance/deposit/post.mdx - Charge:
api-reference/user/charge/post.mdx
Tips
- Store
OPENSTACK_API_KEYas a secret/credential inside your tool; never hardcode in steps. - Always pass a stable pseudonymous
userto get accurate per‑user balances and analytics. - You can start with hosted flows; add Stripe when you want direct capture.