Before you start
- An API key. Create one in Settings under API keys, the same keys the MCP server uses. Its user or organization must be able to edit the project.
- A project id. Every request names an existing project; the API never creates one.
- Credits. Turns are paid with Pascal credits, like messages to the AI assistant. See Credits.
Run a turn
If your plan doesn’t include the effort you asked for, the request is refused with
403 upgrade_required. A request without enough credits gets
402 insufficient_quota.
Images and PDFs can go in the request as input_image and input_file parts, inline
or as file ids from POST /v1/files.
What a turn returns
- The reply is plain text, which can include Markdown. Rich cards that the editor’s chat draws, such as a room-area report, arrive as their text, never as raw JSON.
- The reasoning comes as
reasoningitems (reasoning_contentin Chat Completions): the model’s thinking and one line per step it took. - The version. A turn that changed the scene saves one version, named by
metadata.commit_message. The response reports it asmetadata.pascal_version,pascal_version_labelandpascal_version_url. A turn that changed nothing saves nothing. - Questions. When the Architect needs an answer, the turn ends
completedwithmetadata.pascal_waiting: "question"and the question as the reply. Your next request on the project is the answer; sending just an option’s number picks that option.
The Architect sees its work
During an API turn, the Architect can render views of the scene withview_scene to
check what it built, as it does in the editor’s chat. This works even when you don’t
have the project open.
Run long turns in the background
A request withoutbackground follows its turn for up to 13 minutes. A turn still
running then is stopped, except an architect-pro turn, which keeps running and
answers status: "in_progress" for you to poll. Send work that may take longer, such
as building a house from a floor plan, with background: true. It works with every
model:
queued at once. The turn runs to its end with nobody connected:
credits are charged and the version is saved as for any other turn. Read it with
GET /v1/responses/{id} until it ends completed, incomplete, failed or
cancelled. Stop it with POST /v1/responses/{id}/cancel.
See the Architect’s tool calls
By default a turn shows one reasoning line per step, not the tools behind it. To get each tool call with its arguments and result, as the editor’s chat lists them, ask for them withinclude (Responses only):
mcp_call output item with server_label: "pascal", in the order the
Architect made it: arguments and output are JSON strings, and a call that failed has
error and status: "failed". A background turn asked this way returns its calls when
you poll it; GET /v1/responses/{id}?include=pascal.tool_calls returns them for any
turn you can read.
Cap the credits a turn spends
Setmetadata.pascal_max_credits to the most credits one turn may spend. Like every
metadata value, it’s a string:
providerOptions.openai.metadata. Without a cap there
is no limit. A value that isn’t a number above 0 is refused with a 400 naming
metadata.pascal_max_credits, so a turn never runs uncapped by mistake.
When the turn reaches the cap, it stops starting new work and ends with
status: "incomplete" and incomplete_details.reason: "max_credits" (Chat
Completions: finish_reason: "length"). The work it finished is kept and saved as a
version. Work already under way when the cap is reached finishes, so a turn can end
somewhat above the cap.
Paid service tools such as generate_studio_media and pull_site_data don’t count
toward the cap. Each is charged separately, up to its own maxCredits; see
Hosted services.
Publish and download the 3D file
A turn’s version is saved, not published. To get the project’s 3D file, publish it with the same API key, then download the GLB once it has baked:publishedVersion, didSaveVersion and didPublishVersion.
The GLB route answers:
Every answer except the
404 carries X-Pascal-Version, the published version it
refers to.
Errors and retries
Don’t retry a failed turn automatically: it may already have edited the scene. Every error carriesx-should-retry: false, which the OpenAI SDKs obey. The AI SDK retries
by status code, so pass maxRetries: 0 with its OpenAI providers. A non-streamed
Responses turn that fails after it started answers 200 with status: "failed" and
an error object.