AI
Where AI is used
- The studio’s agent. Every turn of the AI agent that builds your app is a series of AI calls.
- Images drawn in the studio. Asking the studio to draw an image for the app is an AI call too.
Your published apps do not use AI while visitors use them. They keep running when your AI usage runs out.
There is no public AI endpoint. AI in PhiWebs is used through the studio.
How the studio’s AI calls run
The agent works in an isolated sandbox that holds no AI key. Each of its AI calls goes through the PhiWebs AI gate, which:
- checks that the person working is a member of the workspace that owns the project;
- checks that the workspace has AI usage left, or credits it may use;
- holds back enough to pay for the largest answer the call may produce;
- sends the call to the model with your workspace’s AI key. The key never enters the sandbox;
- charges what the call actually used, by tokens, and frees the rest.
If a call ends without reporting what it used, it is charged as the largest answer that was held back for it. A call the model provider refused is not charged.
How AI is paid for
AI is paid for by the workspace, not by the person who is working.
- Your plan’s AI usage comes first. Each plan includes AI usage for a rolling day and a rolling week. It renews by itself as older use falls out of the last 24 hours and the last 7 days.
- AI credits come next, if the owner allows it. Credits are bought separately. They pay only when today’s or this week’s usage is used up and the workspace owner has turned on Continue with credits when usage runs out.
- Otherwise the agent stops until the usage renews. The studio tells you why, and when the usage renews.
You see the workspace’s usage in the studio bar. The Credits page of your account shows the usage bars, the credit balance, the toggle and every charge, with whether usage or credits paid for it. See Billing & plans.
Refusals
When the AI gate refuses a call, the studio shows why. The codes are:
| Status | Code | Meaning |
|---|---|---|
| 402 | CREDIT_LIMIT_EXCEEDED | The usage is used up and credits cannot pay: there are none, or the owner has not allowed them. |
| 429 | PLAN_LIMIT_EXCEEDED | The day’s or the week’s AI usage is used up. It works again once the usage renews. |
| 403 | PLAN_LIMIT_EXCEEDED | A plan limit was reached that does not renew by itself. It changes with the plan. |
AI settings
The AI page of the account shows the workspace’s AI settings and total usage. Only the workspace owner can change them.
Visitor AI
The studio’s Visitor AI panel sets a monthly limit, in credits, on how
much AI a published app’s visitors may use. Published apps do not call AI for
their visitors yet, so the limit has no effect today. Leave it empty to keep
the platform default, set 0 to turn it off, or set unlimited.