pascal-architect model.
Requests and responses use the OpenAI Responses format, with Pascal-specific values in
metadata.
For what a turn does and returns, see Pascal API (v1).
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 works on an existing project.
- Credits. Turns are paid with Pascal credits. See Credits.
await. Save one as
example.ts and run it with npx tsx example.ts.
Point the client at Pascal
Set the base URL tohttps://editor.pascal.app/api/v1 and pass your Pascal API key.
Name the project in metadata.project_id, and the Architect does the turn.
X-Pascal-Project header, for example through
the client’s default headers. The header wins over metadata.project_id.
With the AI SDK, always pass maxRetries: 0. The AI SDK retries by status code, and a
retried turn could edit the scene twice. The OpenAI SDKs already obey Pascal’s
x-should-retry: false header.
Choose an effort
pascal-architect runs at medium effort unless you set reasoning.effort. To fix the
effort, use a model with a suffix instead:
Each model is also available without the
pascal- prefix, as architect,
architect-high and so on. Both names run the same model. GET /v1/models lists them
all.
If your plan doesn’t include the effort you asked for, the request is refused with
403 upgrade_required.
Cap the credits a turn spends
Setmetadata.pascal_max_credits to the most credits the turn may spend. It’s a string,
like every metadata value.
400, so a turn
never runs uncapped by mistake. See Cap the credits a turn
spends for how close to the cap a turn
ends.
Run a long turn in the background, and cancel it
Sendbackground: true for work that may take a while, such as building a floor from a
plan. The request answers queued at once with the response id. Poll it with
responses.retrieve, and stop it with responses.cancel.
completed, incomplete, failed or
cancelled.
Cancelling stops the turn the way the editor’s Stop does, and returns the response
as it ended. Cancelling a turn that already ended returns it as it ended. Any key that
can edit the project can read its turns, but you can only cancel turns started with your
account’s keys. Cancelling someone else’s turn returns 404 turn_not_found, as for a
turn that doesn’t exist.
Without background, a request follows its turn for up to 13 minutes. A turn still
running then is stopped, except a pascal-architect-pro turn, which keeps running and
answers status: "in_progress" for you to poll.
Retry without starting a second turn
A turn edits the scene and spends credits. If a request times out and you don’t know whether its turn started, send it again with the sameIdempotency-Key: you get back
the turn the first request started, as it stands now, instead of a second turn.
Idempotent-Replayed: true. Pascal keeps a key for 24 hours,
for you and the project the request names. The same key with a different request returns
409 idempotency_mismatch, so use a new key for each new request.
Handle errors
An error comes back with an HTTP status and anerror object, which each SDK turns into
an exception. Read the code to decide what to do.
429 rate_limit_exceeded: nothing ran, so
the OpenAI SDKs wait the Retry-After seconds and send it again on their own. With the
AI SDK and maxRetries: 0, wait Retry-After yourself. A request without enough credits
gets 402 insufficient_quota. An unknown model is refused with model_not_found, and
the message lists the valid names. A bad metadata.pascal_max_credits gets
400 invalid_input. Each error’s doc_url links to Errors,
which lists every code.
Get the request id for support
Every answer carries aRequest-Id header. A turn’s reply also carries x-request-id,
the same value as its response id; every other answer, each error included, carries the
Request-Id value there. Each SDK gives it to you, so you can include it when you
contact Pascal.
error.request_id in Python, error.requestID
in TypeScript, and the x-request-id header of the AI SDK’s APICallError.responseHeaders.
Next steps
- Pascal API (v1): what a turn returns, questions, tool calls, and downloading the 3D file.
- OpenAPI document: every route and parameter.