Use cubic in your own products
An OpenAI-compatible API that brings cubic, Square Cloud's AI model, into your chatbots, assistants and automations. If your code already uses an OpenAI SDK, change the base URL and the key.
Beta with free early access, from the Standard plan. Limits and plan availability may change when the beta ends.
Your first request
Point any OpenAI SDK at Square Cloud's base URL, use your account's API key and set the model to cubic.
- Base URL
- https://api.squarecloud.app/v2/ai
- API key
- Your account's key, with the ai:chat scope
- Model
- cubic
import OpenAI from "openai";const client = new OpenAI({ baseURL: "https://api.squarecloud.app/v2/ai", apiKey: process.env.SQUARECLOUD_API_KEY,});const completion = await client.chat.completions.create({ model: "cubic", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "Explain what Square Cloud is in one sentence." }, ],});console.log(completion.choices[0].message.content);curl https://api.squarecloud.app/v2/ai/chat/completions \ -H "Authorization: Bearer $SQUARECLOUD_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "cubic", "messages": [ { "role": "user", "content": "Explain what Square Cloud is in one sentence." } ] }'Built for the code you already have
The gateway follows OpenAI's chat completions format, so moving an existing integration takes a new base URL and a new key.
OpenAI-compatible
Any OpenAI SDK works once its base URL points at api.squarecloud.app/v2/ai. Errors come back in the OpenAI format too.
Function calling
Declare up to 32 tools in the OpenAI format. The model decides when to call one, and your code runs it and sends back the result.
Built-in web search
When a question needs current information, the model searches the web on its own and returns only the final answer, citing the source URLs.
Limits of its own
The gateway's token limits are separate from the dashboard assistant's: API traffic never uses up what Cubic has left in the dashboard, and vice versa.
Limits per plan
Each plan's ceilings during the beta. Hobby and accounts without a plan have no access. Daily limits reset at 00:00 UTC, weekly ones on Monday at 00:00 UTC, and limits and plan availability may change when the beta ends.
| Limit | Standard | Pro | Enterprise |
|---|---|---|---|
| Tokens per day | 2.5M | 5M | 10M - 20M |
| Tokens per week | 10M | 20M | 40M - 80M |
| Requests per day | 1,000 | 5,000 | Unlimited |
| Context (tokens) | 16k | 24k | 32k |
| Max output (tokens) | 4k | 6k | 8k |
| Concurrent requests | 1 | 1 | 2 |
| Interval between requests | 5s | 2s | None |
On Enterprise, the token limit grows with the plan size. Context and output apply per request.
Before you go to production
Three behaviors to plan for when you wire the gateway into a product.
Text only
Text in, text out, by design. Images, audio or files return a 400. Cubic, in the dashboard, is a separate product and accepts images and voice.
No memory between calls
Like OpenAI, the API does not keep conversations. Send the history in messages on every request, up to 100 messages.
Full response, no streaming
For now the response arrives in one piece. Requests with "stream": true return a 400.
A plan for every stage of your project
Start small and scale when you need to, with no loyalty contracts.
Standard
RecommendedFor production, with databases and custom domains
From R$44.99/mo ≈ $8.10
- 4 GB RAM
- 4 vCPU
- Up to 16 projects
- Scales up to 8 GB on the same plan
Pro
For high scale, with daily application snapshots and advanced analytics
From R$124.99/mo ≈ $22.50
- 12 GB RAM
- 6 vCPU
- Up to 48 projects
- Scales up to 24 GB on the same plan
Enterprise
For large operations, with a dedicated account manager
From R$299.90/mo ≈ $53.98
- 32 GB RAM
- 16 vCPU
- Up to 128 projects
- Scales up to 1024 GB on the same plan
The AI Gateway is available from the Standard plan.
Compare all plans4.9 out of 5 · 402 reviews on Google + TrustpilotTrustpilot
AI Gateway FAQ
What is Square Cloud's AI Gateway?
An OpenAI-compatible API for using cubic, Square Cloud's AI model, in your own products, such as chatbots, assistants and automations. You send requests to api.squarecloud.app/v2/ai with your account's API key.
Which plans have access, and what does it cost?
During the beta, Standard, Pro and Enterprise get free early access, within each plan's gateway token limits. Hobby and accounts without a plan have no access. Limits and plan availability may change when the beta ends.
Which model answers?
Always cubic, the same model behind the dashboard assistant. There is no model list to choose from: the model field is accepted for SDK compatibility.
Does the gateway use up Cubic's limits in the dashboard?
No. The gateway has its own daily and weekly token limits, separate from the dashboard assistant's, so neither one uses up the other.
Can I call it from an application hosted on Square Cloud?
Yes, that is the main use case. It is a regular HTTPS API, so it works from anywhere else too.