Square CloudSquare Cloud

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.

From the Standard plan, at no extra cost within each plan's limits. Billed in Brazilian reais, with an invoice issued in Brazil: no international card and no dollar exposure.

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
index.mjs
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
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. Hobby and accounts without a plan have no access. Daily limits reset at 00:00 UTC and weekly ones on Monday at 00:00 UTC.

LimitStandardProEnterprise
Volume
Tokens per day2.5M5M10M - 20M
Tokens per week10M20M40M - 80M
Per request
Context (tokens)64k128k256k
Max output (tokens)6k8k12k
Pace
Concurrent requests4816
Interval between requests1sNoneNone

Models on every plan: cubic, for chat completions with tools and web search, and cubic-decision, for typed decisions (POST /v2/ai/decisions). Both share the same limits.

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 500 messages.

  • Streaming in the OpenAI format

    With "stream": true the reply arrives in parts, as chat.completion.chunk, and the OpenAI SDKs work unchanged.

A plan for every stage of your project

From your first deploy to 1 TB of RAM, without switching platforms. Each phase adds memory and features to the one before, and upgrades apply instantly.

The AI Gateway is available from the Standard plan.

Compare all plans
4 GB → 8 GB

Standard

Recommended

Production with databases, your own domain and a team.

  • Up to 4 vCPU
  • Databases
  • Custom domain
  • Load balancer
  • AI Gateway
  • Workspaces

FromR$44.99/mo

12 GB → 24 GB

Pro

More memory, daily snapshots and visibility into what runs.

  • Up to 12 vCPU
  • Daily application snapshots
  • Performance analytics
  • Cubic Pro and routines
  • Priority support

FromR$124.99/mo

32 GB → 1 TB

Enterprise

Large operations, with a private Discord channel.

  • Up to 16 vCPU
  • Private Discord channel

FromR$299.90/mo

StandardProEnterprise
Compute
RAM4 GB → 8 GB12 GB → 24 GB32 GB → 1 TB
vCPU46 → 1216
Platform
Real-time metricsIncludedIncludedIncluded
Blob StorageIncludedIncludedIncluded
One-click rollbackIncludedIncludedIncluded
Square Shield anti-DDoSIncludedIncludedIncluded
Cubic AI agentIncludedIncludedIncluded
DatabasesIncludedIncludedIncluded
Custom domainIncludedIncludedIncluded
Load balancerapps per domain2510
AI GatewayIncludedIncludedIncluded
Daily application snapshotsNot includedIncludedIncluded
Performance analyticsNot includedIncludedIncluded
Cubic Pro and routinesNot includedIncludedIncluded
Team and support
Workspacesmembers per workspace3 → 710 → 2020 → 50
Priority supportNot includedIncludedIncluded
Private Discord channelNot includedNot includedIncluded

4.9 out of 5

482 reviews on Google and Trustpilot

Hosted in a partner datacenter with certifications

  • Tier 3
  • ISO 27001
  • SOC 2 Type II
  • Always-On DDoS Protection
Explore our infrastructure

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?

Standard, Pro and Enterprise get access at no extra cost, within each plan's gateway token limits. Above them, you keep going with AI credits and, on Enterprise, pay-as-you-go. Hobby and accounts without a plan have no access.

Which models can I use?

cubic, the same model behind the dashboard assistant, answers chat completions, with tools and web search. For typed questions about a text (yes or no, a choice between options, a score on a scale), use cubic-decision at POST /v2/ai/decisions. Both come with every plan that has access and share the same limits.

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.

Ship your project today

Join the 500,000+ developers who have used Square Cloud to host their projects.

  • Deploy in seconds via GitHub, CLI or .zip
  • Isolated, always-on containers
  • Automatic TLS on every domain
  • Anti-DDoS on layers 3, 4 and 7
  • Snapshots with 1-click restore
  • Cubic, the AI agent, on every plan
  • Fixed price in reais, with NFS-e
  • No per-request charges