One copilot turn, streamed. Two protocols answer on this route for one release, chosen by `Accept`.
THE UI MESSAGE STREAM. List `application/vnd.phoneuse.ui-message-stream` in `Accept` and send the AI SDK transport's body: `{id, messages, trigger, messageId}`, where `id` is the thread id (a new one opens the thread) and `messages` is the client's transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state `approval-responded` answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client's copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is `text/event-stream` with the header `x-vercel-ai-ui-message-stream: v1`, one `data: <chunk>` frame per chunk, ended by `data: [DONE]`. It opens with `start` (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as `tool-input-available` before it runs and `tool-output-available` (`{summary, text, frameId?}`), `tool-output-error` (`errorText`, which the protocol requires, and when the tool itself failed also `{message, code, retryable, retryAfterMs?}` beside it, on the stream only and never on a stored part) or `tool-output-denied` after, a `file` chunk with a `data:` URL for a screenshot of at most 204800 bytes, `data-device-choice` ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, `data-suggestions` ({items:[{text, deviceId}]}, at most three, each naming a device) before `finish` on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with `finish` (`finishReason`, and `messageMetadata.stopReason` from the copilot's own closed set) or with `error`, after which nothing follows.
WHEN IT FAILS (API-232). `copilot_unfunded` means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. `rate_limited` is the provider throttling and is worth retrying. `model_unavailable` is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; `model_refused`, `tool_failed` and `internal` complete the set. The older event stream still reports the first three as `model_unavailable`, because its console branches on the set as it stood.
APPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: `tool-approval-request` carries an `approvalId` and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with `finish{finishReason: "tool-calls"}`. The descriptor says which card to draw and why: `kind` is `light` (one line and one row) or `plan` (a goal with an editable `budget` of `maxSteps` and `deadlineMs`), and `reason.code` is `start_run`, `install_app`, `dangerous_operation` or `boundary`. When one question covers the same tool on SEVERAL phones the descriptor carries `calls: [{toolCallId, tool, input}]` and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card.
Answer by sending the same thread again with the assistant message's tool part in state `approval-responded` (`approval: {id, approved, reason?, input?, descriptor?}`); the next stream continues the same assistant message: the tool runs, or `tool-output-denied` ends the turn. `approval.input` is the person's EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool's published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo `approval.descriptor.reason`, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with `tool-output-error`. A turn takes at most 12 model steps, across the requests an approval splits it into.
Closing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with `finishReason: "stop"`. A tool already running completes and its receipt stands.
THE EVENT STREAM (older). Any other `Accept`, or none, selects it. Send `{prompt}`; the response is a `text/event-stream` whose frames are named SSE events: `session.start` once, first; `message.delta` prose; `tool.call` a tool is ABOUT TO RUN; `tool.result` it finished, `isError` being the tool's own verdict; `approval.request` a question, the turn PAUSED; `tool.denied` you said no or nobody answered; `ping` keep-alive; `done` with a `stopReason`; `error` with a `code`. Exactly one `done` or one `error` ends every stream. Approvals are answered on `POST /v1/copilot/approvals`, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched.
WHICH PHONE (API-228). Both shapes take an optional `context` and `mentions`. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a `data-device-choice` chunk carries the candidates, the call is answered `tool-output-error`, and no phone is touched. A device id in `context` or `mentions` that your session cannot address is 400 naming the field; every wrong field is named in the one answer.
Needs a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes.
Hosted deployments only. A local checkout does not mount this route, so calling it there is a 404.
POST
/
v1
/
copilot
Error
A valid request URL is required to generate request examples
The control surface credential. Send Authorization: Bearer <token>.
Two kinds of token are accepted and they are told apart by shape, not by a separate header. A token beginning pbk_ or puk_ is an org scoped API key, whose public half and secret half are generated together and of which only a hash of the secret is ever stored; anything else is treated as an OAuth 2.1 access token and verified against the authorization server's keys.
Both resolve to the same context: an org, a principal and a set of scopes. Nothing downstream branches on which channel you used, with one deliberate exception, key management, which requires a signed-in person so that a key can never mint another key.
Scopes are enforced when MCP tools are REGISTERED rather than when they are called, so a tool your credential cannot use is absent from tools/list rather than refused mid gesture.
Headers
Accept
string
List application/vnd.phoneuse.ui-message-stream to be answered with the UI message stream. Anything else, or no header, selects the older event stream. The response is text/event-stream either way.
Body
application/json
What to ask, in the shape of the protocol selected by Accept.
PromptBody
ChatTransportBody
prompt
string
required
What you want, in a sentence. A turn is a message, not a document. The older protocol's body.
Required string length: 1 - 4000
context
CopilotContext · object
What the console knows and the sentence does not say. Every device id here must be one your session can address, or the request is 400 naming the field. Resolution order for which phone a turn is about: pinned, then mentions, then context.device, then the device this thread last acted on, then the only device you have, then a data-device-choice card. THIS BLOCK IS NOT REPLAYED: it describes where somebody is now, so it is read from this request only and never from the stored thread.
Show child attributes
mentions
string[]
Device ids the person named with an @ in this message. The id travels, never the typed name, so renaming a phone cannot re-point a message. Exactly one names the turn's device; two or more raise the chooser.
Maximum array length: 10
Response
The stream. It stays open until the turn ends. Which protocol it speaks is in the header below.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PhoneUse","description":"The mobile execution layer for AI agents.","colors":{"primary":"#0c6b4f","light":"#12a06a","dark":"#0a5a43"},"logo":{"light":"https://mintcdn.com/phonebase/asSC9ooLxq3ce7AH/images/logo-light.svg?fit=max\u0026auto=format\u0026n=asSC9ooLxq3ce7AH\u0026q=85\u0026s=797a832db8f0e271d5dbd6beba29a27b","dark":"https://mintcdn.com/phonebase/asSC9ooLxq3ce7AH/images/logo-dark.svg?fit=max\u0026auto=format\u0026n=asSC9ooLxq3ce7AH\u0026q=85\u0026s=82325f8969ce89102cc6e3af558a4436","href":"https://phoneuse.com"},"favicon":"https://mintcdn.com/phonebase/asSC9ooLxq3ce7AH/images/favicon.svg?fit=max\u0026auto=format\u0026n=asSC9ooLxq3ce7AH\u0026q=85\u0026s=5aebe1e05fdad8394b3f4d54e6e75f22","appearance":{"default":"light"},"navbar":{"primary":{"type":"button","label":"Main site","href":"https://phoneuse.com"}},"footer":{"socials":{"website":"https://phoneuse.com"}},"contextual":{"options":["copy","view","claude","chatgpt","cursor","vscode","mcp"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"phonebase","hasAudioNarration":false,"actualSubdomain":"phonebase","customDomains":["docs.phoneuse.com"],"gitSource":{"type":"github","owner":"phoneuse-official","repo":"phoneuse-api","deployBranch":"docs-release","contentDirectory":"docs/site","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6afd0a6c8745fb0d64fce35c","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"default","tag":"API","count":158},{"language":"default","tag":"Endpoints","count":155},{"language":"default","tag":"Docs","count":34},{"language":"default","tag":"Managed Proxy","count":22},{"language":"default","tag":"Minute billing","count":22},{"language":"default","tag":"Devices","count":19},{"language":"default","tag":"Apps","count":18},{"language":"default","tag":"Provisioning","count":14},{"language":"default","tag":"API keys","count":12},{"language":"default","tag":"Copilot","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api/endpoints/copilot/ask-the-copilot","slug":"/api/endpoints/copilot/ask-the-copilot","pageMetadata":{"title":"Ask the copilot","description":"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by `Accept`.\n\nTHE UI MESSAGE STREAM. List `application/vnd.phoneuse.ui-message-stream` in `Accept` and send the AI SDK transport's body: `{id, messages, trigger, messageId}`, where `id` is the thread id (a new one opens the thread) and `messages` is the client's transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state `approval-responded` answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client's copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is `text/event-stream` with the header `x-vercel-ai-ui-message-stream: v1`, one `data: \u003cchunk>` frame per chunk, ended by `data: [DONE]`. It opens with `start` (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as `tool-input-available` before it runs and `tool-output-available` (`{summary, text, frameId?}`), `tool-output-error` (`errorText`, which the protocol requires, and when the tool itself failed also `{message, code, retryable, retryAfterMs?}` beside it, on the stream only and never on a stored part) or `tool-output-denied` after, a `file` chunk with a `data:` URL for a screenshot of at most 204800 bytes, `data-device-choice` ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, `data-suggestions` ({items:[{text, deviceId}]}, at most three, each naming a device) before `finish` on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with `finish` (`finishReason`, and `messageMetadata.stopReason` from the copilot's own closed set) or with `error`, after which nothing follows.\n\nWHEN IT FAILS (API-232). `copilot_unfunded` means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. `rate_limited` is the provider throttling and is worth retrying. `model_unavailable` is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; `model_refused`, `tool_failed` and `internal` complete the set. The older event stream still reports the first three as `model_unavailable`, because its console branches on the set as it stood.\n\nAPPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: `tool-approval-request` carries an `approvalId` and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with `finish{finishReason: \"tool-calls\"}`. The descriptor says which card to draw and why: `kind` is `light` (one line and one row) or `plan` (a goal with an editable `budget` of `maxSteps` and `deadlineMs`), and `reason.code` is `start_run`, `install_app`, `dangerous_operation` or `boundary`. When one question covers the same tool on SEVERAL phones the descriptor carries `calls: [{toolCallId, tool, input}]` and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card.\n\nAnswer by sending the same thread again with the assistant message's tool part in state `approval-responded` (`approval: {id, approved, reason?, input?, descriptor?}`); the next stream continues the same assistant message: the tool runs, or `tool-output-denied` ends the turn. `approval.input` is the person's EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool's published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo `approval.descriptor.reason`, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with `tool-output-error`. A turn takes at most 12 model steps, across the requests an approval splits it into.\n\nClosing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with `finishReason: \"stop\"`. A tool already running completes and its receipt stands.\n\nTHE EVENT STREAM (older). Any other `Accept`, or none, selects it. Send `{prompt}`; the response is a `text/event-stream` whose frames are named SSE events: `session.start` once, first; `message.delta` prose; `tool.call` a tool is ABOUT TO RUN; `tool.result` it finished, `isError` being the tool's own verdict; `approval.request` a question, the turn PAUSED; `tool.denied` you said no or nobody answered; `ping` keep-alive; `done` with a `stopReason`; `error` with a `code`. Exactly one `done` or one `error` ends every stream. Approvals are answered on `POST /v1/copilot/approvals`, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched.\n\nWHICH PHONE (API-228). Both shapes take an optional `context` and `mentions`. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a `data-device-choice` chunk carries the candidates, the call is answered `tool-output-error`, and no phone is touched. A device id in `context` or `mentions` that your session cannot address is 400 naming the field; every wrong field is named in the one answer.\n\nNeeds a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes.\n\nHosted deployments only. A local checkout does not mount this route, so calling it there is a 404.","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/copilot","href":"/api/endpoints/copilot/ask-the-copilot","autogeneratedByOpenApi":true},"description":"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by `Accept`.\n\nTHE UI MESSAGE STREAM. List `application/vnd.phoneuse.ui-message-stream` in `Accept` and send the AI SDK transport's body: `{id, messages, trigger, messageId}`, where `id` is the thread id (a new one opens the thread) and `messages` is the client's transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state `approval-responded` answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client's copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is `text/event-stream` with the header `x-vercel-ai-ui-message-stream: v1`, one `data: \u003cchunk>` frame per chunk, ended by `data: [DONE]`. It opens with `start` (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as `tool-input-available` before it runs and `tool-output-available` (`{summary, text, frameId?}`), `tool-output-error` (`errorText`, which the protocol requires, and when the tool itself failed also `{message, code, retryable, retryAfterMs?}` beside it, on the stream only and never on a stored part) or `tool-output-denied` after, a `file` chunk with a `data:` URL for a screenshot of at most 204800 bytes, `data-device-choice` ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, `data-suggestions` ({items:[{text, deviceId}]}, at most three, each naming a device) before `finish` on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with `finish` (`finishReason`, and `messageMetadata.stopReason` from the copilot's own closed set) or with `error`, after which nothing follows.\n\nWHEN IT FAILS (API-232). `copilot_unfunded` means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. `rate_limited` is the provider throttling and is worth retrying. `model_unavailable` is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; `model_refused`, `tool_failed` and `internal` complete the set. The older event stream still reports the first three as `model_unavailable`, because its console branches on the set as it stood.\n\nAPPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: `tool-approval-request` carries an `approvalId` and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with `finish{finishReason: \"tool-calls\"}`. The descriptor says which card to draw and why: `kind` is `light` (one line and one row) or `plan` (a goal with an editable `budget` of `maxSteps` and `deadlineMs`), and `reason.code` is `start_run`, `install_app`, `dangerous_operation` or `boundary`. When one question covers the same tool on SEVERAL phones the descriptor carries `calls: [{toolCallId, tool, input}]` and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card.\n\nAnswer by sending the same thread again with the assistant message's tool part in state `approval-responded` (`approval: {id, approved, reason?, input?, descriptor?}`); the next stream continues the same assistant message: the tool runs, or `tool-output-denied` ends the turn. `approval.input` is the person's EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool's published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo `approval.descriptor.reason`, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with `tool-output-error`. A turn takes at most 12 model steps, across the requests an approval splits it into.\n\nClosing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with `finishReason: \"stop\"`. A tool already running completes and its receipt stands.\n\nTHE EVENT STREAM (older). Any other `Accept`, or none, selects it. Send `{prompt}`; the response is a `text/event-stream` whose frames are named SSE events: `session.start` once, first; `message.delta` prose; `tool.call` a tool is ABOUT TO RUN; `tool.result` it finished, `isError` being the tool's own verdict; `approval.request` a question, the turn PAUSED; `tool.denied` you said no or nobody answered; `ping` keep-alive; `done` with a `stopReason`; `error` with a `code`. Exactly one `done` or one `error` ends every stream. Approvals are answered on `POST /v1/copilot/approvals`, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched.\n\nWHICH PHONE (API-228). Both shapes take an optional `context` and `mentions`. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a `data-device-choice` chunk carries the candidates, the call is answered `tool-output-error`, and no phone is touched. A device id in `context` or `mentions` that your session cannot address is 400 naming the field; every wrong field is named in the one answer.\n\nNeeds a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes.\n\nHosted deployments only. A local checkout does not mount this route, so calling it there is a 404.","pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Ask the copilot","description":"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by `Accept`.\n\nTHE UI MESSAGE STREAM. List `application/vnd.phoneuse.ui-message-stream` in `Accept` and send the AI SDK transport's body: `{id, messages, trigger, messageId}`, where `id` is the thread id (a new one opens the thread) and `messages` is the client's transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state `approval-responded` answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client's copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is `text/event-stream` with the header `x-vercel-ai-ui-message-stream: v1`, one `data: \u003cchunk>` frame per chunk, ended by `data: [DONE]`. It opens with `start` (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as `tool-input-available` before it runs and `tool-output-available` (`{summary, text, frameId?}`), `tool-output-error` (`errorText`, which the protocol requires, and when the tool itself failed also `{message, code, retryable, retryAfterMs?}` beside it, on the stream only and never on a stored part) or `tool-output-denied` after, a `file` chunk with a `data:` URL for a screenshot of at most 204800 bytes, `data-device-choice` ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, `data-suggestions` ({items:[{text, deviceId}]}, at most three, each naming a device) before `finish` on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with `finish` (`finishReason`, and `messageMetadata.stopReason` from the copilot's own closed set) or with `error`, after which nothing follows.\n\nWHEN IT FAILS (API-232). `copilot_unfunded` means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. `rate_limited` is the provider throttling and is worth retrying. `model_unavailable` is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; `model_refused`, `tool_failed` and `internal` complete the set. The older event stream still reports the first three as `model_unavailable`, because its console branches on the set as it stood.\n\nAPPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: `tool-approval-request` carries an `approvalId` and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with `finish{finishReason: \"tool-calls\"}`. The descriptor says which card to draw and why: `kind` is `light` (one line and one row) or `plan` (a goal with an editable `budget` of `maxSteps` and `deadlineMs`), and `reason.code` is `start_run`, `install_app`, `dangerous_operation` or `boundary`. When one question covers the same tool on SEVERAL phones the descriptor carries `calls: [{toolCallId, tool, input}]` and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card.\n\nAnswer by sending the same thread again with the assistant message's tool part in state `approval-responded` (`approval: {id, approved, reason?, input?, descriptor?}`); the next stream continues the same assistant message: the tool runs, or `tool-output-denied` ends the turn. `approval.input` is the person's EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool's published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo `approval.descriptor.reason`, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with `tool-output-error`. A turn takes at most 12 model steps, across the requests an approval splits it into.\n\nClosing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with `finishReason: \"stop\"`. A tool already running completes and its receipt stands.\n\nTHE EVENT STREAM (older). Any other `Accept`, or none, selects it. Send `{prompt}`; the response is a `text/event-stream` whose frames are named SSE events: `session.start` once, first; `message.delta` prose; `tool.call` a tool is ABOUT TO RUN; `tool.result` it finished, `isError` being the tool's own verdict; `approval.request` a question, the turn PAUSED; `tool.denied` you said no or nobody answered; `ping` keep-alive; `done` with a `stopReason`; `error` with a `code`. Exactly one `done` or one `error` ends every stream. Approvals are answered on `POST /v1/copilot/approvals`, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched.\n\nWHICH PHONE (API-228). Both shapes take an optional `context` and `mentions`. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a `data-device-choice` chunk carries the candidates, the call is answered `tool-output-error`, and no phone is touched. A device id in `context` or `mentions` that your session cannot address is 400 naming the field; every wrong field is named in the one answer.\n\nNeeds a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes.\n\nHosted deployments only. A local checkout does not mount this route, so calling it there is a 404.","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/copilot","href":"/api/endpoints/copilot/ask-the-copilot","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"postV1Copilot","tags":["Copilot"],"summary":"Ask the copilot","description":"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by `Accept`.\n\nTHE UI MESSAGE STREAM. List `application/vnd.phoneuse.ui-message-stream` in `Accept` and send the AI SDK transport's body: `{id, messages, trigger, messageId}`, where `id` is the thread id (a new one opens the thread) and `messages` is the client's transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state `approval-responded` answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client's copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is `text/event-stream` with the header `x-vercel-ai-ui-message-stream: v1`, one `data: \u003cchunk>` frame per chunk, ended by `data: [DONE]`. It opens with `start` (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as `tool-input-available` before it runs and `tool-output-available` (`{summary, text, frameId?}`), `tool-output-error` (`errorText`, which the protocol requires, and when the tool itself failed also `{message, code, retryable, retryAfterMs?}` beside it, on the stream only and never on a stored part) or `tool-output-denied` after, a `file` chunk with a `data:` URL for a screenshot of at most 204800 bytes, `data-device-choice` ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, `data-suggestions` ({items:[{text, deviceId}]}, at most three, each naming a device) before `finish` on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with `finish` (`finishReason`, and `messageMetadata.stopReason` from the copilot's own closed set) or with `error`, after which nothing follows.\n\nWHEN IT FAILS (API-232). `copilot_unfunded` means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. `rate_limited` is the provider throttling and is worth retrying. `model_unavailable` is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; `model_refused`, `tool_failed` and `internal` complete the set. The older event stream still reports the first three as `model_unavailable`, because its console branches on the set as it stood.\n\nAPPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: `tool-approval-request` carries an `approvalId` and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with `finish{finishReason: \"tool-calls\"}`. The descriptor says which card to draw and why: `kind` is `light` (one line and one row) or `plan` (a goal with an editable `budget` of `maxSteps` and `deadlineMs`), and `reason.code` is `start_run`, `install_app`, `dangerous_operation` or `boundary`. When one question covers the same tool on SEVERAL phones the descriptor carries `calls: [{toolCallId, tool, input}]` and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card.\n\nAnswer by sending the same thread again with the assistant message's tool part in state `approval-responded` (`approval: {id, approved, reason?, input?, descriptor?}`); the next stream continues the same assistant message: the tool runs, or `tool-output-denied` ends the turn. `approval.input` is the person's EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool's published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo `approval.descriptor.reason`, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with `tool-output-error`. A turn takes at most 12 model steps, across the requests an approval splits it into.\n\nClosing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with `finishReason: \"stop\"`. A tool already running completes and its receipt stands.\n\nTHE EVENT STREAM (older). Any other `Accept`, or none, selects it. Send `{prompt}`; the response is a `text/event-stream` whose frames are named SSE events: `session.start` once, first; `message.delta` prose; `tool.call` a tool is ABOUT TO RUN; `tool.result` it finished, `isError` being the tool's own verdict; `approval.request` a question, the turn PAUSED; `tool.denied` you said no or nobody answered; `ping` keep-alive; `done` with a `stopReason`; `error` with a `code`. Exactly one `done` or one `error` ends every stream. Approvals are answered on `POST /v1/copilot/approvals`, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched.\n\nWHICH PHONE (API-228). Both shapes take an optional `context` and `mentions`. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a `data-device-choice` chunk carries the candidates, the call is answered `tool-output-error`, and no phone is touched. A device id in `context` or `mentions` that your session cannot address is 400 naming the field; every wrong field is named in the one answer.\n\nNeeds a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes.\n\nHosted deployments only. A local checkout does not mount this route, so calling it there is a 404.","x-phoneuse-modes":["hosted"],"x-phoneuse-credential":"bearer","parameters":["908abb8f-167c-4d76-af22-34cec2d6a335"],"requestBody":"1aa9a182-bbc7-4fb2-820f-039577f7f071","security":["a9e1abaf-61e4-4efb-8576-694a6971e791"],"responses":{"200":"a9fd50eb-2265-4c40-b5c2-9abc93d27a4f","400":"64c13606-e990-47d7-a2c0-fff24b50c0dd","401":"03b4bad8-4709-4355-8371-8479425e0d77","403":"5f7c3099-398e-4cd9-8a93-aff0d15d95e3","404":"f08e0420-0330-4260-946f-b2aedbee8fa2","409":"faf4b517-d08c-4753-8125-fcd250b0bd9b","413":"137d61cc-2967-4a8c-81f7-d4864bf1f11c","429":"bf70138c-a047-4287-afec-96f23353631e","503":"e418be3b-36f3-455c-a744-c54c3e791136"},"method":"post","type":"path","servers":["0b8b9ab5-c46d-4bb8-88b0-6eeb0d5654ea"],"path":"/v1/copilot","baseUrlOptions":["{origin}"],"title":"Ask the copilot","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"908abb8f-167c-4d76-af22-34cec2d6a335":{"name":"Accept","in":"header","required":false,"description":"List `application/vnd.phoneuse.ui-message-stream` to be answered with the UI message stream. Anything else, or no header, selects the older event stream. The response is `text/event-stream` either way.","schema":{"type":"string","isRequired":false,"description":"List `application/vnd.phoneuse.ui-message-stream` to be answered with the UI message stream. Anything else, or no header, selects the older event stream. The response is `text/event-stream` either way.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"description":"What to ask, in the shape of the protocol selected by `Accept`.","required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"PromptBody","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"What you want, in a sentence. A turn is a message, not a document. The older protocol's body.","isRequired":true,"uniqueKey":"oneOf.0.prompt","typeLabel":"string"},"context":{"type":"object","properties":{"route":{"type":"string","description":"The console route being viewed, e.g. `/devices/pixel-1`. Orientation for the model; never parsed for ids.","maxLength":200,"uniqueKey":"oneOf.0.context.route","typeLabel":"string"},"device":{"type":"object","properties":{"id":{"type":"string","description":"The device that page is about.","isRequired":true,"uniqueKey":"oneOf.0.context.device.id","typeLabel":"string"}},"required":["id"],"additionalProperties":true,"uniqueKey":"oneOf.0.context.device","typeLabel":"object"},"run":{"type":"object","properties":{"id":{"type":"string","description":"The agent run that page is about.","isRequired":true,"uniqueKey":"oneOf.0.context.run.id","typeLabel":"string"}},"required":["id"],"additionalProperties":true,"uniqueKey":"oneOf.0.context.run","typeLabel":"object"},"selection":{"type":"object","properties":{"deviceIds":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.context.selection.deviceIds.items.[INDEX]","typeLabel":"string"},"description":"Devices ticked on a list page. More than one always asks which comes first.","isRequired":true,"uniqueKey":"oneOf.0.context.selection.deviceIds","typeLabel":"string[]"}},"required":["deviceIds"],"additionalProperties":true,"uniqueKey":"oneOf.0.context.selection","typeLabel":"object"},"pinned":{"type":"object","properties":{"deviceId":{"type":"string","description":"A device pinned to this thread. Outranks every other source.","isRequired":true,"uniqueKey":"oneOf.0.context.pinned.deviceId","typeLabel":"string"}},"required":["deviceId"],"additionalProperties":true,"uniqueKey":"oneOf.0.context.pinned","typeLabel":"object"}},"required":[],"additionalProperties":true,"title":"CopilotContext","description":"What the console knows and the sentence does not say. Every device id here must be one your session can address, or the request is 400 naming the field. Resolution order for which phone a turn is about: `pinned`, then `mentions`, then `context.device`, then the device this thread last acted on, then the only device you have, then a `data-device-choice` card. THIS BLOCK IS NOT REPLAYED: it describes where somebody is now, so it is read from this request only and never from the stored thread.","uniqueKey":"oneOf.0.context","typeLabel":"CopilotContext · object"},"mentions":{"type":"array","maxItems":10,"items":{"type":"string","uniqueKey":"oneOf.0.mentions.items.[INDEX]","typeLabel":"string"},"description":"Device ids the person named with an `@` in this message. The id travels, never the typed name, so renaming a phone cannot re-point a message. Exactly one names the turn's device; two or more raise the chooser.","uniqueKey":"oneOf.0.mentions","typeLabel":"string[]"}},"additionalProperties":false,"uniqueKey":"oneOf.0","typeLabel":"PromptBody · object"},{"type":"object","title":"ChatTransportBody","required":["id","messages"],"properties":{"id":{"type":"string","description":"The thread id. A new id opens a new thread owned by you; an id that is not your live thread answers 404.","pattern":"^[A-Za-z0-9_-]{1,128}$","isRequired":true,"uniqueKey":"oneOf.1.id","typeLabel":"string"},"messages":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","description":"Assigned by this service. The id a client sent for a user message is not kept.","isRequired":true,"uniqueKey":"oneOf.1.messages.items.[INDEX].id","typeLabel":"string"},"role":{"type":"string","enum":["user","assistant"],"description":"Who wrote it. There are no system messages in a thread.","isRequired":true,"uniqueKey":"oneOf.1.messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"parts":{"type":"array","description":"The message as parts, in the AI SDK's UIMessage shape and order: `text`, `reasoning`, `step-start`, `file`, `data-*` (the device chooser and the follow-up suggestions), and `tool-\u003cname>` parts carrying `toolCallId`, `input`, a `state` and, by state, `output`, `errorText` or `approval`. A thread replays into a chat client without translation.\n\nAn `approval` carries `{id, descriptor}` while the question is open and `{id, approved, reason?, input?, descriptor?}` once it is answered, and keeps those fields after the call has run: `input` is the edit the person sent with the answer, so a settled card still shows which edited values it ran with. The descriptor is `{tool, arguments, prompt, kind, reason:{code}, summary?, budget?, calls?, runHold?, expiresAt?}`: `kind` is `light` or `plan`, `reason.code` is one of `start_run`, `install_app`, `dangerous_operation`, `boundary`, and `calls` is present only when one card covers several phones. `runHold` is `{runId, pausedAt}` on a `resume_run` card: the run and the hold (`pausedAt`, or null for not paused) the card showed. Descriptors written before those fields existed carry neither `kind` nor `reason`; read a missing `kind` as `light`.","items":{"type":"object","uniqueKey":"oneOf.1.messages.items.[INDEX].parts.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"oneOf.1.messages.items.[INDEX].parts","typeLabel":"object[]"},"metadata":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","isRequired":true,"uniqueKey":"oneOf.1.messages.items.[INDEX].metadata.createdAt","typeLabel":"string\u003cdate-time>"},"acceptedMode":{"type":"string","enum":["auto","ask","manual"],"description":"Server-stored permission mode for the original instruction and approval attempt. Client metadata never grants authority.","uniqueKey":"oneOf.1.messages.items.[INDEX].metadata.acceptedMode","typeLabel":"enum\u003cstring>"},"finishReason":{"type":"string","description":"How an assistant message ended, in the stream's words: `stop`, `tool-calls`, `length`, `other` or `error`. Absent on a user message.","uniqueKey":"oneOf.1.messages.items.[INDEX].metadata.finishReason","typeLabel":"string"},"stopReason":{"type":"string","enum":["completed","max_steps","approval_expired","denied","awaiting_approval","aborted"],"description":"The copilot's own reason, finer than finishReason. Absent on a user message.","uniqueKey":"oneOf.1.messages.items.[INDEX].metadata.stopReason","typeLabel":"enum\u003cstring>"}},"required":["createdAt"],"additionalProperties":false,"isRequired":true,"uniqueKey":"oneOf.1.messages.items.[INDEX].metadata","typeLabel":"object"}},"required":["id","role","parts","metadata"],"additionalProperties":false,"uniqueKey":"oneOf.1.messages.items.[INDEX]","typeLabel":"object"},"description":"The client's transcript. Only the LAST message is read: a user message with text parts of at most 4000 characters together, or an assistant message carrying an approval answer.","isRequired":true,"uniqueKey":"oneOf.1.messages","typeLabel":"object[]"},"trigger":{"type":"string","enum":["submit-message","regenerate-message"],"description":"Read only when the last message's id is one this thread already stores (see 409). `regenerate-message` then asks for a new answer to the newest question, without storing the question again; anything else gets the stored answer back.","uniqueKey":"oneOf.1.trigger","typeLabel":"enum\u003cstring>"},"messageId":{"type":"string","description":"Accepted and not read.","uniqueKey":"oneOf.1.messageId","typeLabel":"string"},"instructionMode":{"type":"string","enum":["auto","ask","manual"],"description":"Optional mode for this instruction only. Does not change the saved thread mode or grant absent rights. Omit on approval resume; that uses the original server snapshot.","uniqueKey":"oneOf.1.instructionMode","typeLabel":"enum\u003cstring>"},"context":{"type":"object","properties":{"route":{"type":"string","description":"The console route being viewed, e.g. `/devices/pixel-1`. Orientation for the model; never parsed for ids.","maxLength":200,"uniqueKey":"oneOf.1.context.route","typeLabel":"string"},"device":{"type":"object","properties":{"id":{"type":"string","description":"The device that page is about.","isRequired":true,"uniqueKey":"oneOf.1.context.device.id","typeLabel":"string"}},"required":["id"],"additionalProperties":true,"uniqueKey":"oneOf.1.context.device","typeLabel":"object"},"run":{"type":"object","properties":{"id":{"type":"string","description":"The agent run that page is about.","isRequired":true,"uniqueKey":"oneOf.1.context.run.id","typeLabel":"string"}},"required":["id"],"additionalProperties":true,"uniqueKey":"oneOf.1.context.run","typeLabel":"object"},"selection":{"type":"object","properties":{"deviceIds":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.1.context.selection.deviceIds.items.[INDEX]","typeLabel":"string"},"description":"Devices ticked on a list page. More than one always asks which comes first.","isRequired":true,"uniqueKey":"oneOf.1.context.selection.deviceIds","typeLabel":"string[]"}},"required":["deviceIds"],"additionalProperties":true,"uniqueKey":"oneOf.1.context.selection","typeLabel":"object"},"pinned":{"type":"object","properties":{"deviceId":{"type":"string","description":"A device pinned to this thread. Outranks every other source.","isRequired":true,"uniqueKey":"oneOf.1.context.pinned.deviceId","typeLabel":"string"}},"required":["deviceId"],"additionalProperties":true,"uniqueKey":"oneOf.1.context.pinned","typeLabel":"object"}},"required":[],"additionalProperties":true,"title":"CopilotContext","description":"What the console knows and the sentence does not say. Every device id here must be one your session can address, or the request is 400 naming the field. Resolution order for which phone a turn is about: `pinned`, then `mentions`, then `context.device`, then the device this thread last acted on, then the only device you have, then a `data-device-choice` card. THIS BLOCK IS NOT REPLAYED: it describes where somebody is now, so it is read from this request only and never from the stored thread.","uniqueKey":"oneOf.1.context","typeLabel":"CopilotContext · object"},"mentions":{"type":"array","maxItems":10,"items":{"type":"string","uniqueKey":"oneOf.1.mentions.items.[INDEX]","typeLabel":"string"},"description":"Device ids the person named with an `@` in this message. The id travels, never the typed name, so renaming a phone cannot re-point a message. Exactly one names the turn's device; two or more raise the chooser.","uniqueKey":"oneOf.1.mentions","typeLabel":"string[]"}},"additionalProperties":true,"uniqueKey":"oneOf.1","typeLabel":"ChatTransportBody · object"}],"uniqueKey":"","typeLabel":"PromptBody · object | ChatTransportBody · object"},"examples":{"Example":{"title":"Example","value":{"prompt":"\u003cstring>","context":{"route":"\u003cstring>"},"mentions":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"a9fd50eb-2265-4c40-b5c2-9abc93d27a4f":{"description":"The stream. It stays open until the turn ends. Which protocol it speaks is in the header below.","headers":{"x-vercel-ai-ui-message-stream":{"description":"`v1` when the UI message stream was selected; absent on the older event stream.","schema":{"type":"string"}}},"content":{"text/event-stream":{}},"exampleType":"generated"},"64c13606-e990-47d7-a2c0-fff24b50c0dd":{"description":"A missing or unusable `prompt`, a transport body whose last message carries neither text nor an approval answer, a `context` / `mentions` block naming a device this session cannot address, an `approval.input` edit the tool's schema refuses, or an echoed `approval.descriptor.reason.code` that is not the one the question was asked with. The message names every field that is wrong.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["backend_resolution_failed","backend_not_implemented","device_unavailable","device_disconnected","lease_mismatch","lease_required","capability_unsupported","invalid_argument","backend_command_failed","idempotency_conflict","action_outcome_unknown","stale_frame","internal_error","unauthorized","permission_denied","run_not_found","frame_not_found","device_busy","admission_unavailable","checkout_unavailable","checkout_customer_balance","checkout_in_progress","quote_changed","payment_in_progress","out_of_stock","wrong_state","instance_not_served","reverification_required","not_found","receipt_not_found","rate_limited","payload_too_large","origin_not_allowed","api_key_from_browser_origin","key_predates_instance_attribution","org_not_served_by_instance","tenant_binding_unavailable","tenant_binding_unsettled","fleet_at_capacity","forbidden","service_unavailable","invalid_signature","invalid_event","not_settled"],"description":"The closed set of codes this service answers with on purpose, on MCP tools and REST alike (D152). What each one means and when you get it is on the errors page.","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A human readable summary. Do not branch on it, branch on `code`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"retryable":{"type":"boolean","description":"Whether re-issuing the same call unchanged is meaningful. It is a property of the occurrence, not of the code, so read the field rather than inferring it.","uniqueKey":"error.retryable","typeLabel":"boolean"}},"required":["code","message"],"additionalProperties":true,"description":"Specific errors add their own fields, such as `deviceId`, `reason` or `capability`. Read the ones you branch on and ignore the rest.","isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"The control surface error envelope. Every non 2xx JSON body on this surface has this shape.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"backend_resolution_failed","message":"\u003cstring>","retryable":true}}}},"exampleType":"generated"}},"exampleType":"generated"},"03b4bad8-4709-4355-8371-8479425e0d77":{"description":"No credential, or one that was refused.","headers":{"WWW-Authenticate":{"description":"A bearer challenge. On a hosted deployment it names the metadata document to discover the authorization server from, and it adds `error=\"invalid_token\"` when a credential was presented and rejected.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","const":"unauthorized","description":"Always `unauthorized` on this response.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"reason":{"type":"string","enum":["missing_credentials","malformed_credentials","invalid_token","token_expired","wrong_audience","missing_org","missing_org_role","unknown_key","revoked_key","expired_key"],"description":"The closed set of ways authentication can fail.","isRequired":true,"uniqueKey":"error.reason","typeLabel":"enum\u003cstring>"},"hint":{"type":"string","description":"A next step in prose, on the reasons where there is one to give: `revoked_key`, `expired_key`, `missing_org_role`, and `invalid_token` when the account is not a member of the named organization. Absent otherwise, so branch on `reason` and show this if it is there.","uniqueKey":"error.hint","typeLabel":"string"}},"required":["code","reason"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"A refused credential. `unknown_key` covers both a keyId nobody has and a secret that does not match, because telling those apart would enumerate keys for you. Revocation and expiry are distinguishable, since you owned that key.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"unauthorized","reason":"missing_credentials","hint":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"5f7c3099-398e-4cd9-8a93-aff0d15d95e3":{"description":"An API key. A copilot acts as a person, and a key is nobody.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["backend_resolution_failed","backend_not_implemented","device_unavailable","device_disconnected","lease_mismatch","lease_required","capability_unsupported","invalid_argument","backend_command_failed","idempotency_conflict","action_outcome_unknown","stale_frame","internal_error","unauthorized","permission_denied","run_not_found","frame_not_found","device_busy","admission_unavailable","checkout_unavailable","checkout_customer_balance","checkout_in_progress","quote_changed","payment_in_progress","out_of_stock","wrong_state","instance_not_served","reverification_required","not_found","receipt_not_found","rate_limited","payload_too_large","origin_not_allowed","api_key_from_browser_origin","key_predates_instance_attribution","org_not_served_by_instance","tenant_binding_unavailable","tenant_binding_unsettled","fleet_at_capacity","forbidden","service_unavailable","invalid_signature","invalid_event","not_settled"],"description":"The closed set of codes this service answers with on purpose, on MCP tools and REST alike (D152). What each one means and when you get it is on the errors page.","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A human readable summary. Do not branch on it, branch on `code`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"retryable":{"type":"boolean","description":"Whether re-issuing the same call unchanged is meaningful. It is a property of the occurrence, not of the code, so read the field rather than inferring it.","uniqueKey":"error.retryable","typeLabel":"boolean"}},"required":["code","message"],"additionalProperties":true,"description":"Specific errors add their own fields, such as `deviceId`, `reason` or `capability`. Read the ones you branch on and ignore the rest.","isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"The control surface error envelope. Every non 2xx JSON body on this surface has this shape.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"backend_resolution_failed","message":"\u003cstring>","retryable":true}}}},"exampleType":"generated"}},"exampleType":"generated"},"f08e0420-0330-4260-946f-b2aedbee8fa2":{"description":"The thread id is not your live thread, or no approval is waiting on the id you answered.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","const":"not_found","description":"Always `not_found` on this response.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A human readable summary naming the kind of thing that was not found.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"No such thing that you may act on. Not an existence oracle over other organisations' ids.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"not_found","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"faf4b517-d08c-4753-8125-fcd250b0bd9b":{"description":"`idempotency_conflict`. The last message's `id` is the idempotency key of that message: a retry under the same id never stores the question twice. Sent again once it has an answer, the stored answer is streamed back and nothing runs (`regenerate-message` on the newest question runs a new answer instead). 409 when the id already names DIFFERENT content in this thread (`retryable: false`; send new words under a new id), or when the first request for that message is still being answered (`retryable: true`; wait, or read it back from `GET /v1/copilot/threads/{id}/stream`). One turn runs on a thread at a time, from the request until its answer is stored: a message, retry or approval answer sent while another is still finishing gets 409 with `reason: \"thread_busy\"`, `retryable: true` and `retryAfterMs`; send it again after that wait.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["backend_resolution_failed","backend_not_implemented","device_unavailable","device_disconnected","lease_mismatch","lease_required","capability_unsupported","invalid_argument","backend_command_failed","idempotency_conflict","action_outcome_unknown","stale_frame","internal_error","unauthorized","permission_denied","run_not_found","frame_not_found","device_busy","admission_unavailable","checkout_unavailable","checkout_customer_balance","checkout_in_progress","quote_changed","payment_in_progress","out_of_stock","wrong_state","instance_not_served","reverification_required","not_found","receipt_not_found","rate_limited","payload_too_large","origin_not_allowed","api_key_from_browser_origin","key_predates_instance_attribution","org_not_served_by_instance","tenant_binding_unavailable","tenant_binding_unsettled","fleet_at_capacity","forbidden","service_unavailable","invalid_signature","invalid_event","not_settled"],"description":"The closed set of codes this service answers with on purpose, on MCP tools and REST alike (D152). What each one means and when you get it is on the errors page.","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"A human readable summary. Do not branch on it, branch on `code`.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"retryable":{"type":"boolean","description":"Whether re-issuing the same call unchanged is meaningful. It is a property of the occurrence, not of the code, so read the field rather than inferring it.","uniqueKey":"error.retryable","typeLabel":"boolean"}},"required":["code","message"],"additionalProperties":true,"description":"Specific errors add their own fields, such as `deviceId`, `reason` or `capability`. Read the ones you branch on and ignore the rest.","isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"The control surface error envelope. Every non 2xx JSON body on this surface has this shape.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"backend_resolution_failed","message":"\u003cstring>","retryable":true}}}},"exampleType":"generated"}},"exampleType":"generated"},"137d61cc-2967-4a8c-81f7-d4864bf1f11c":{"description":"The request body exceeds the server's limit (1 MiB). Refused before the body is parsed, so nothing was partially applied. Retrying the same body will fail the same way: send less. Per-field limits are tighter than this and are documented on the fields themselves; this is the backstop underneath them. The shape is the same on ordinary JSON surfaces, /vrx included. The explicitly configured APK content stream documents its own byte ceiling.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","const":"payload_too_large","description":"Always `payload_too_large` on this response.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A human readable summary naming the limit in bytes.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"Returned when the request body exceeds the server limit. Identical on every surface, including /vrx.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"payload_too_large","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"bf70138c-a047-4287-afec-96f23353631e":{"description":"Over the request budget for this caller. Hosted deployments only. Which budget applied depends on whether this request carried an `Authorization` header, not on which endpoint it was aimed at. Wait `Retry-After` seconds and retry the same request: the refusal happens before any work, so nothing was partially applied. See /api/rate-limits.","headers":{"Retry-After":{"description":"Whole seconds until one request is available again. Computed from the caller's own remaining allowance, not a fixed constant.","schema":{"type":"string"}},"RateLimit-Limit":{"description":"The budget in effect for this caller class, in requests per minute.","schema":{"type":"string"}},"RateLimit-Remaining":{"description":"Whole requests that were still available when this request was admitted. Zero on a 429.","schema":{"type":"string"}},"RateLimit-Reset":{"description":"Seconds until the allowance is back to full. Longer than `Retry-After`, which is the wait for a single request.","schema":{"type":"string"}},"RateLimit-Policy":{"description":"The budget and its window, as `\u003climit>;w=60`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","const":"rate_limited","description":"Always `rate_limited` on this response.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A human readable summary. The numbers are in the headers, not in here.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"Over the request budget. Raised by the rate limiter before any handler runs, which is why its code is not one of the action codes: nothing was attempted, so no action failed.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"rate_limited","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"},"e418be3b-36f3-455c-a744-c54c3e791136":{"description":"This deployment has no copilot configured.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","const":"service_unavailable","description":"Always `service_unavailable` on this response.","isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","description":"A human readable summary naming the surface this deployment does not serve.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"}},"required":["code","message"],"additionalProperties":false,"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"required":["error"],"additionalProperties":false,"description":"This deployment does not serve that surface. No `Retry-After`: waiting does not help.","uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"code":"service_unavailable","message":"\u003cstring>"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"a9e1abaf-61e4-4efb-8576-694a6971e791":{"bearerAuth":{"type":"http","scheme":"bearer","description":"The control surface credential. Send `Authorization: Bearer \u003ctoken>`.\n\nTwo kinds of token are accepted and they are told apart by shape, not by a separate header. A token beginning `pbk_` or `puk_` is an org scoped API key, whose public half and secret half are generated together and of which only a hash of the secret is ever stored; anything else is treated as an OAuth 2.1 access token and verified against the authorization server's keys.\n\nBoth resolve to the same context: an org, a principal and a set of scopes. Nothing downstream branches on which channel you used, with one deliberate exception, key management, which requires a signed-in person so that a key can never mint another key.\n\nScopes are enforced when MCP tools are REGISTERED rather than when they are called, so a tool your credential cannot use is absent from `tools/list` rather than refused mid gesture.","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"0b8b9ab5-c46d-4bb8-88b0-6eeb0d5654ea":{"url":"{origin}","description":"Your control plane origin.","variables":{"origin":{"default":"https://mcp.phoneuse.com","enum":["https://mcp.phoneuse.com","http://127.0.0.1:8788"],"description":"The hosted deployment serves the public origin its metadata document advertises, and that is the default here. Select the loopback entry instead when you are running a local checkout, which serves the port `PORT` names."}}}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"The control surface credential. Send `Authorization: Bearer \u003ctoken>`.\n\nTwo kinds of token are accepted and they are told apart by shape, not by a separate header. A token beginning `pbk_` or `puk_` is an org scoped API key, whose public half and secret half are generated together and of which only a hash of the secret is ever stored; anything else is treated as an OAuth 2.1 access token and verified against the authorization server's keys.\n\nBoth resolve to the same context: an org, a principal and a set of scopes. Nothing downstream branches on which channel you used, with one deliberate exception, key management, which requires a signed-in person so that a key can never mint another key.\n\nScopes are enforced when MCP tools are REGISTERED rather than when they are called, so a tool your credential cannot use is absent from `tools/list` rather than refused mid gesture.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"The control surface credential. Send `Authorization: Bearer \u003ctoken>`.\n\nTwo kinds of token are accepted and they are told apart by shape, not by a separate header. A token beginning `pbk_` or `puk_` is an org scoped API key, whose public half and secret half are generated together and of which only a hash of the secret is ever stored; anything else is treated as an OAuth 2.1 access token and verified against the authorization server's keys.\n\nBoth resolve to the same context: an org, a principal and a set of scopes. Nothing downstream branches on which channel you used, with one deliberate exception, key management, which requires a signed-in person so that a key can never mint another key.\n\nScopes are enforced when MCP tools are REGISTERED rather than when they are called, so a tool your credential cannot use is absent from `tools/list` rather than refused mid gesture.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api/openapi.json"},"subdomain":"phonebase","siteName":"PhoneUse","title":"Ask the copilot - PhoneUse","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T04:26:06.557Z","originalFileLocation":"api/endpoints/copilot/ask-the-copilot.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by Accept. THE UI MESSAGE STREAM. List application/vnd.phoneuse.ui-message-stream in Accept and send the AI SDK transport\u0026#x27;s body: {id, messages, trigger, messageId}, where id is the thread id (a new one opens the thread) and messages is the client\u0026#x27;s transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state approval-responded answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client\u0026#x27;s copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is text/event-stream with the header x-vercel-ai-ui-message-stream: v1, one data: frame per chunk, ended by data: [DONE]. It opens with start (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as tool-input-available before it runs and tool-output-available ({summary, text, frameId?}), tool-output-error (errorText, which the protocol requires, and when the tool itself failed also {message, code, retryable, retryAfterMs?} beside it, on the stream only and never on a stored part) or tool-output-denied after, a file chunk with a data: URL for a screenshot of at most 204800 bytes, data-device-choice ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, data-suggestions ({items:[{text, deviceId}]}, at most three, each naming a device) before finish on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with finish (finishReason, and messageMetadata.stopReason from the copilot\u0026#x27;s own closed set) or with error, after which nothing follows. WHEN IT FAILS (API-232). copilot_unfunded means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. rate_limited is the provider throttling and is worth retrying. model_unavailable is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; model_refused, tool_failed and internal complete the set. The older event stream still reports the first three as model_unavailable, because its console branches on the set as it stood. APPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: tool-approval-request carries an approvalId and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with finish{finishReason: \u0026quot;tool-calls\u0026quot;}. The descriptor says which card to draw and why: kind is light (one line and one row) or plan (a goal with an editable budget of maxSteps and deadlineMs), and reason.code is start_run, install_app, dangerous_operation or boundary. When one question covers the same tool on SEVERAL phones the descriptor carries calls: [{toolCallId, tool, input}] and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card. Answer by sending the same thread again with the assistant message\u0026#x27;s tool part in state approval-responded (approval: {id, approved, reason?, input?, descriptor?}); the next stream continues the same assistant message: the tool runs, or tool-output-denied ends the turn. approval.input is the person\u0026#x27;s EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool\u0026#x27;s published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo approval.descriptor.reason, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with tool-output-error. A turn takes at most 12 model steps, across the requests an approval splits it into. Closing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with finishReason: \u0026quot;stop\u0026quot;. A tool already running completes and its receipt stands. THE EVENT STREAM (older). Any other Accept, or none, selects it. Send {prompt}; the response is a text/event-stream whose frames are named SSE events: session.start once, first; message.delta prose; tool.call a tool is ABOUT TO RUN; tool.result it finished, isError being the tool\u0026#x27;s own verdict; approval.request a question, the turn PAUSED; tool.denied you said no or nobody answered; ping keep-alive; done with a stopReason; error with a code. Exactly one done or one error ends every stream. Approvals are answered on POST /v1/copilot/approvals, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched. WHICH PHONE (API-228). Both shapes take an optional context and mentions. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a data-device-choice chunk carries the candidates, the call is answered tool-output-error, and no phone is touched. A device id in context or mentions that your session cannot address is 400 naming the field; every wrong field is named in the one answer. Needs a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes. Hosted deployments only. A local checkout does not mount this route, so calling it there is a 404.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PhoneUse\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Ask the copilot - PhoneUse\">\u003cmeta data-mint-head property=\"og:description\" content=\"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by Accept. THE UI MESSAGE STREAM. List application/vnd.phoneuse.ui-message-stream in Accept and send the AI SDK transport\u0026#x27;s body: {id, messages, trigger, messageId}, where id is the thread id (a new one opens the thread) and messages is the client\u0026#x27;s transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state approval-responded answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client\u0026#x27;s copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is text/event-stream with the header x-vercel-ai-ui-message-stream: v1, one data: frame per chunk, ended by data: [DONE]. It opens with start (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as tool-input-available before it runs and tool-output-available ({summary, text, frameId?}), tool-output-error (errorText, which the protocol requires, and when the tool itself failed also {message, code, retryable, retryAfterMs?} beside it, on the stream only and never on a stored part) or tool-output-denied after, a file chunk with a data: URL for a screenshot of at most 204800 bytes, data-device-choice ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, data-suggestions ({items:[{text, deviceId}]}, at most three, each naming a device) before finish on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with finish (finishReason, and messageMetadata.stopReason from the copilot\u0026#x27;s own closed set) or with error, after which nothing follows. WHEN IT FAILS (API-232). copilot_unfunded means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. rate_limited is the provider throttling and is worth retrying. model_unavailable is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; model_refused, tool_failed and internal complete the set. The older event stream still reports the first three as model_unavailable, because its console branches on the set as it stood. APPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: tool-approval-request carries an approvalId and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with finish{finishReason: \u0026quot;tool-calls\u0026quot;}. The descriptor says which card to draw and why: kind is light (one line and one row) or plan (a goal with an editable budget of maxSteps and deadlineMs), and reason.code is start_run, install_app, dangerous_operation or boundary. When one question covers the same tool on SEVERAL phones the descriptor carries calls: [{toolCallId, tool, input}] and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card. Answer by sending the same thread again with the assistant message\u0026#x27;s tool part in state approval-responded (approval: {id, approved, reason?, input?, descriptor?}); the next stream continues the same assistant message: the tool runs, or tool-output-denied ends the turn. approval.input is the person\u0026#x27;s EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool\u0026#x27;s published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo approval.descriptor.reason, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with tool-output-error. A turn takes at most 12 model steps, across the requests an approval splits it into. Closing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with finishReason: \u0026quot;stop\u0026quot;. A tool already running completes and its receipt stands. THE EVENT STREAM (older). Any other Accept, or none, selects it. Send {prompt}; the response is a text/event-stream whose frames are named SSE events: session.start once, first; message.delta prose; tool.call a tool is ABOUT TO RUN; tool.result it finished, isError being the tool\u0026#x27;s own verdict; approval.request a question, the turn PAUSED; tool.denied you said no or nobody answered; ping keep-alive; done with a stopReason; error with a code. Exactly one done or one error ends every stream. Approvals are answered on POST /v1/copilot/approvals, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched. WHICH PHONE (API-228). Both shapes take an optional context and mentions. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a data-device-choice chunk carries the candidates, the call is answered tool-output-error, and no phone is touched. A device id in context or mentions that your session cannot address is 400 naming the field; every wrong field is named in the one answer. Needs a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes. Hosted deployments only. A local checkout does not mount this route, so calling it there is a 404.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PhoneUse\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://phonebase.mintlify.site/_mintlify/api/og/v2?division=Copilot\u0026amp;title=Ask+the+copilot\u0026amp;description=One+copilot+turn%2C+streamed.+Two+protocols+answer+on+this+route+for+one+release%2C+chosen+by+%60Accept%60.%0A%0ATHE+UI+MESSAGE+STREAM.+List+%60application%2Fvnd.phoneuse.ui-me\u0026amp;theme=370fb2999dfbb8f85a217f41\u0026amp;signature=abea5591242b78afd0071973edd365d0a3989d9c0a09e43d2ee688748530db74\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Ask the copilot - PhoneUse\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by Accept. THE UI MESSAGE STREAM. List application/vnd.phoneuse.ui-message-stream in Accept and send the AI SDK transport\u0026#x27;s body: {id, messages, trigger, messageId}, where id is the thread id (a new one opens the thread) and messages is the client\u0026#x27;s transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state approval-responded answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client\u0026#x27;s copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is text/event-stream with the header x-vercel-ai-ui-message-stream: v1, one data: frame per chunk, ended by data: [DONE]. It opens with start (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as tool-input-available before it runs and tool-output-available ({summary, text, frameId?}), tool-output-error (errorText, which the protocol requires, and when the tool itself failed also {message, code, retryable, retryAfterMs?} beside it, on the stream only and never on a stored part) or tool-output-denied after, a file chunk with a data: URL for a screenshot of at most 204800 bytes, data-device-choice ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, data-suggestions ({items:[{text, deviceId}]}, at most three, each naming a device) before finish on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with finish (finishReason, and messageMetadata.stopReason from the copilot\u0026#x27;s own closed set) or with error, after which nothing follows. WHEN IT FAILS (API-232). copilot_unfunded means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. rate_limited is the provider throttling and is worth retrying. model_unavailable is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; model_refused, tool_failed and internal complete the set. The older event stream still reports the first three as model_unavailable, because its console branches on the set as it stood. APPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: tool-approval-request carries an approvalId and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with finish{finishReason: \u0026quot;tool-calls\u0026quot;}. The descriptor says which card to draw and why: kind is light (one line and one row) or plan (a goal with an editable budget of maxSteps and deadlineMs), and reason.code is start_run, install_app, dangerous_operation or boundary. When one question covers the same tool on SEVERAL phones the descriptor carries calls: [{toolCallId, tool, input}] and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card. Answer by sending the same thread again with the assistant message\u0026#x27;s tool part in state approval-responded (approval: {id, approved, reason?, input?, descriptor?}); the next stream continues the same assistant message: the tool runs, or tool-output-denied ends the turn. approval.input is the person\u0026#x27;s EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool\u0026#x27;s published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo approval.descriptor.reason, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with tool-output-error. A turn takes at most 12 model steps, across the requests an approval splits it into. Closing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with finishReason: \u0026quot;stop\u0026quot;. A tool already running completes and its receipt stands. THE EVENT STREAM (older). Any other Accept, or none, selects it. Send {prompt}; the response is a text/event-stream whose frames are named SSE events: session.start once, first; message.delta prose; tool.call a tool is ABOUT TO RUN; tool.result it finished, isError being the tool\u0026#x27;s own verdict; approval.request a question, the turn PAUSED; tool.denied you said no or nobody answered; ping keep-alive; done with a stopReason; error with a code. Exactly one done or one error ends every stream. Approvals are answered on POST /v1/copilot/approvals, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched. WHICH PHONE (API-228). Both shapes take an optional context and mentions. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a data-device-choice chunk carries the candidates, the call is answered tool-output-error, and no phone is touched. A device id in context or mentions that your session cannot address is 400 naming the field; every wrong field is named in the one answer. Needs a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes. Hosted deployments only. A local checkout does not mount this route, so calling it there is a 404.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://phonebase.mintlify.site/_mintlify/api/og/v2?division=Copilot\u0026amp;title=Ask+the+copilot\u0026amp;description=One+copilot+turn%2C+streamed.+Two+protocols+answer+on+this+route+for+one+release%2C+chosen+by+%60Accept%60.%0A%0ATHE+UI+MESSAGE+STREAM.+List+%60application%2Fvnd.phoneuse.ui-me\u0026amp;theme=370fb2999dfbb8f85a217f41\u0026amp;signature=abea5591242b78afd0071973edd365d0a3989d9c0a09e43d2ee688748530db74\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/phonebase/kWipq_KjnF--s93A/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PhoneUse\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0c6b4f\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/endpoints/copilot/ask-the-copilot.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.phoneuse.com/#organization\",\"name\":\"PhoneUse\",\"url\":\"https://docs.phoneuse.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/phonebase/asSC9ooLxq3ce7AH/images/logo-light.svg?fit=max\u0026auto=format\u0026n=asSC9ooLxq3ce7AH\u0026q=85\u0026s=797a832db8f0e271d5dbd6beba29a27b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.phoneuse.com#website\",\"name\":\"PhoneUse\",\"url\":\"https://docs.phoneuse.com\",\"publisher\":{\"@id\":\"https://docs.phoneuse.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot#webpage\",\"url\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot\",\"name\":\"Ask the copilot\",\"description\":\"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by Accept. THE UI MESSAGE STREAM. List application/vnd.phoneuse.ui-message-stream in Accept and send the AI SDK transport's body: {id, messages, trigger, messageId}, where id is the thread id (a new one opens the thread) and messages is the client's transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state approval-responded answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client's copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is text/event-stream with the header x-vercel-ai-ui-message-stream: v1, one data: frame per chunk, ended by data: [DONE]. It opens with start (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as tool-input-available before it runs and tool-output-available ({summary, text, frameId?}), tool-output-error (errorText, which the protocol requires, and when the tool itself failed also {message, code, retryable, retryAfterMs?} beside it, on the stream only and never on a stored part) or tool-output-denied after, a file chunk with a data: URL for a screenshot of at most 204800 bytes, data-device-choice ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, data-suggestions ({items:[{text, deviceId}]}, at most three, each naming a device) before finish on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with finish (finishReason, and messageMetadata.stopReason from the copilot's own closed set) or with error, after which nothing follows. WHEN IT FAILS (API-232). copilot_unfunded means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. rate_limited is the provider throttling and is worth retrying. model_unavailable is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; model_refused, tool_failed and internal complete the set. The older event stream still reports the first three as model_unavailable, because its console branches on the set as it stood. APPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: tool-approval-request carries an approvalId and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with finish{finishReason: \\\"tool-calls\\\"}. The descriptor says which card to draw and why: kind is light (one line and one row) or plan (a goal with an editable budget of maxSteps and deadlineMs), and reason.code is start_run, install_app, dangerous_operation or boundary. When one question covers the same tool on SEVERAL phones the descriptor carries calls: [{toolCallId, tool, input}] and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card. Answer by sending the same thread again with the assistant message's tool part in state approval-responded (approval: {id, approved, reason?, input?, descriptor?}); the next stream continues the same assistant message: the tool runs, or tool-output-denied ends the turn. approval.input is the person's EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool's published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo approval.descriptor.reason, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with tool-output-error. A turn takes at most 12 model steps, across the requests an approval splits it into. Closing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with finishReason: \\\"stop\\\". A tool already running completes and its receipt stands. THE EVENT STREAM (older). Any other Accept, or none, selects it. Send {prompt}; the response is a text/event-stream whose frames are named SSE events: session.start once, first; message.delta prose; tool.call a tool is ABOUT TO RUN; tool.result it finished, isError being the tool's own verdict; approval.request a question, the turn PAUSED; tool.denied you said no or nobody answered; ping keep-alive; done with a stopReason; error with a code. Exactly one done or one error ends every stream. Approvals are answered on POST /v1/copilot/approvals, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched. WHICH PHONE (API-228). Both shapes take an optional context and mentions. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a data-device-choice chunk carries the candidates, the call is answered tool-output-error, and no phone is touched. A device id in context or mentions that your session cannot address is 400 naming the field; every wrong field is named in the one answer. Needs a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes. Hosted deployments only. A local checkout does not mount this route, so calling it there is a 404.\",\"dateModified\":\"2026-10-30T04:26:06.557Z\",\"isPartOf\":{\"@id\":\"https://docs.phoneuse.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.phoneuse.com/api/endpoints/health/check-that-the-service-is-up\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ask the copilot\",\"item\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot#apireference\",\"headline\":\"Ask the copilot\",\"name\":\"Ask the copilot\",\"description\":\"One copilot turn, streamed. Two protocols answer on this route for one release, chosen by Accept. THE UI MESSAGE STREAM. List application/vnd.phoneuse.ui-message-stream in Accept and send the AI SDK transport's body: {id, messages, trigger, messageId}, where id is the thread id (a new one opens the thread) and messages is the client's transcript. ONLY THE LAST MESSAGE IS READ: a user message (its text parts) starts a turn, and an assistant message carrying a tool part in state approval-responded answers the question the previous turn ended on. The history the model is shown is the STORED thread, within a budget of 48000 characters of transcript, never the client's copy. What the budget cuts away is NOT forgotten: it is folded into a short summary the copilot writes once and keeps with the thread, shown in front of the recent messages on every turn after that, so a long conversation still knows what it was started for and which phone it was about. Nothing rebuildable from the server goes into that summary. The response is text/event-stream with the header x-vercel-ai-ui-message-stream: v1, one data: frame per chunk, ended by data: [DONE]. It opens with start (naming the assistant message being written, which is the message a resumed approval continues), carries text and reasoning as deltas, every tool call as tool-input-available before it runs and tool-output-available ({summary, text, frameId?}), tool-output-error (errorText, which the protocol requires, and when the tool itself failed also {message, code, retryable, retryAfterMs?} beside it, on the stream only and never on a stored part) or tool-output-denied after, a file chunk with a data: URL for a screenshot of at most 204800 bytes, data-device-choice ({reason, devices:[{id, label}]}) when a call needed a phone and none was named, data-suggestions ({items:[{text, deviceId}]}, at most three, each naming a device) before finish on a turn that completed -- both of those ARE parts and survive a replay of the thread, and ends with finish (finishReason, and messageMetadata.stopReason from the copilot's own closed set) or with error, after which nothing follows. WHEN IT FAILS (API-232). copilot_unfunded means the copilot has no credit ON OUR SIDE: the message is the sentence to show, nothing the caller did caused it, and their phone and direct commands are unaffected. rate_limited is the provider throttling and is worth retrying. model_unavailable is the model being unreachable. Those three were ONE code until now, so a client could only ever say the vaguest of them; model_refused, tool_failed and internal complete the set. The older event stream still reports the first three as model_unavailable, because its console branches on the set as it stood. APPROVALS RIDE THE STREAM. Anything that changes the phone, takes or hands back the device, or starts an agent run asks first: tool-approval-request carries an approvalId and a descriptor with the tool, its arguments and one sentence to show, and the stream ENDS with finish{finishReason: \\\"tool-calls\\\"}. The descriptor says which card to draw and why: kind is light (one line and one row) or plan (a goal with an editable budget of maxSteps and deadlineMs), and reason.code is start_run, install_app, dangerous_operation or boundary. When one question covers the same tool on SEVERAL phones the descriptor carries calls: [{toolCallId, tool, input}] and one yes runs all of them, each as its own call with its own receipt; a dangerous operation is never folded into that list and always gets its own card. Answer by sending the same thread again with the assistant message's tool part in state approval-responded (approval: {id, approved, reason?, input?, descriptor?}); the next stream continues the same assistant message: the tool runs, or tool-output-denied ends the turn. approval.input is the person's EDIT of the arguments on a plan card: it is MERGED over the arguments they were shown, so sending only the field they changed does not delete the rest, and it is re-checked against the tool's published input schema. An edit the schema refuses is 400 naming the field, and nothing runs. If you echo approval.descriptor.reason, it must be the code the question was asked with, or the answer is 400: consent shown for one reason is not consent for another. Echoing nothing is accepted. The question does NOT expire on a clock: it waits until you answer it (Confirm or Decline) or a new message on the thread supersedes it, which closes it with tool-output-error. A turn takes at most 12 model steps, across the requests an approval splits it into. Closing the request aborts the turn: the copilot stops before its next step or tool call, what was written is kept, and the stored message ends with finishReason: \\\"stop\\\". A tool already running completes and its receipt stands. THE EVENT STREAM (older). Any other Accept, or none, selects it. Send {prompt}; the response is a text/event-stream whose frames are named SSE events: session.start once, first; message.delta prose; tool.call a tool is ABOUT TO RUN; tool.result it finished, isError being the tool's own verdict; approval.request a question, the turn PAUSED; tool.denied you said no or nobody answered; ping keep-alive; done with a stopReason; error with a code. Exactly one done or one error ends every stream. Approvals are answered on POST /v1/copilot/approvals, a SEPARATE request, while the stream stays open; a client that closes the stream to answer loses the turn. This protocol goes in the release after the console has switched. WHICH PHONE (API-228). Both shapes take an optional context and mentions. When they name a device, the turn is about it: the model is told so, a call that needs a device and names none is given that one, and it does not ask which phone. When nothing names one and you have several, a data-device-choice chunk carries the candidates, the call is answered tool-output-error, and no phone is touched. A device id in context or mentions that your session cannot address is 400 naming the field; every wrong field is named in the one answer. Needs a signed in person. A copilot acts as somebody, and an API key has nobody behind it; drive the tools directly through the MCP endpoint instead. The turn can reach exactly the tools your session already has, no more, because it drives the same tool surface this service publishes. Hosted deployments only. A local checkout does not mount this route, so calling it there is a 404.\",\"url\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot\",\"mainEntityOfPage\":{\"@id\":\"https://docs.phoneuse.com/api/endpoints/copilot/ask-the-copilot#webpage\"},\"dateModified\":\"2026-10-30T04:26:06.557Z\",\"publisher\":{\"@id\":\"https://docs.phoneuse.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.phoneuse.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PhoneUse\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"PhoneUse\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/endpoints/copilot/ask-the-copilot.md","siteName":"PhoneUse","nav":{"global":null,"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":""}]},{"tab":"API","groups":[{"group":"Overview","pages":[{"title":"API overview","href":"/api"},{"title":"Versioning and compatibility","href":"/api/versioning"},{"title":"Rate limits","href":"/api/rate-limits"}]},{"group":"Endpoints","pages":[{"group":"Health","pages":[{"title":"Check that the service is up","deprecated":null,"version":null,"openapi":"/api/openapi.json get /healthz","href":"/api/endpoints/health/check-that-the-service-is-up"}]},{"group":"Device surface","pages":[{"title":"Check the run's device channel","deprecated":null,"version":null,"openapi":"/api/openapi.json get /vrx/{runToken}/v1/health","href":"/api/endpoints/device-surface/check-the-runs-device-channel"},{"title":"List the run's device","deprecated":null,"version":null,"openapi":"/api/openapi.json get /vrx/{runToken}/v1/devices","href":"/api/endpoints/device-surface/list-the-runs-device"},{"title":"Fetch a frame","deprecated":null,"version":null,"openapi":"/api/openapi.json get /vrx/{runToken}/v1/devices/{deviceId}/screenshot","href":"/api/endpoints/device-surface/fetch-a-frame"},{"title":"Report the run's outcome","deprecated":null,"version":null,"openapi":"/api/openapi.json post /vrx/{runToken}/v1/report","href":"/api/endpoints/device-surface/report-the-runs-outcome"},{"title":"Act on the device","deprecated":null,"version":null,"openapi":"/api/openapi.json post /vrx/{runToken}/v1/devices/{deviceId}/actions","href":"/api/endpoints/device-surface/act-on-the-device"}]},{"group":"MCP","pages":[{"title":"Why there is no event stream","deprecated":null,"version":null,"openapi":"/api/openapi.json get /mcp","href":"/api/endpoints/mcp/why-there-is-no-event-stream"},{"title":"Send a JSON-RPC request","deprecated":null,"version":null,"openapi":"/api/openapi.json post /mcp","href":"/api/endpoints/mcp/send-a-json-rpc-request"},{"title":"Why there is no session to end","deprecated":null,"version":null,"openapi":"/api/openapi.json delete /mcp","href":"/api/endpoints/mcp/why-there-is-no-session-to-end"}]},{"group":"Apps","pages":[{"title":"Discover visible devices and authoritative application scopes","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-library/device-capabilities","href":"/api/endpoints/apps/discover-visible-devices-and-authoritative-application-scopes"},{"title":"Read last confirmed phone apps","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-library/inventory","href":"/api/endpoints/apps/read-last-confirmed-phone-apps"},{"title":"Request bounded read-only application checks","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/app-library/inventory/refreshes","href":"/api/endpoints/apps/request-bounded-read-only-application-checks"},{"title":"Read application-check progress","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-library/inventory/refreshes/{refreshId}","href":"/api/endpoints/apps/read-application-check-progress"},{"title":"Read per-device check outcomes","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-library/inventory/refreshes/{refreshId}/results","href":"/api/endpoints/apps/read-per-device-check-outcomes"},{"title":"Recover a lost mutation response by original key","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-library/requests/{requestKey}","href":"/api/endpoints/apps/recover-a-lost-mutation-response-by-original-key"},{"title":"List installable apps","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-store/catalog","href":"/api/endpoints/apps/list-installable-apps"},{"title":"Read installation history","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-store/installations","href":"/api/endpoints/apps/read-installation-history"},{"title":"Install an app","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/app-store/installations","href":"/api/endpoints/apps/install-an-app"},{"title":"Recover an app installation","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-store/installations/by-request/{requestKey}","href":"/api/endpoints/apps/recover-an-app-installation"},{"title":"Check an app installation","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-store/installations/{installationId}","href":"/api/endpoints/apps/check-an-app-installation"},{"title":"Check an app installation again","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/app-store/installations/{installationId}/recheck","href":"/api/endpoints/apps/check-an-app-installation-again"},{"title":"Skip checking an unconfirmed installation","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/app-store/installations/{installationId}/skip","href":"/api/endpoints/apps/skip-checking-an-unconfirmed-installation"},{"title":"Read a phone's install queue","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-store/queue","href":"/api/endpoints/apps/read-a-phones-install-queue"},{"title":"Add an app to a phone's install queue","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/app-store/queue","href":"/api/endpoints/apps/add-an-app-to-a-phones-install-queue"},{"title":"Recover a queued app by its request key","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/app-store/queue/by-request/{requestKey}","href":"/api/endpoints/apps/recover-a-queued-app-by-its-request-key"},{"title":"Remove a waiting app from a phone's queue","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/app-store/queue/{entryId}/remove","href":"/api/endpoints/apps/remove-a-waiting-app-from-a-phones-queue"},{"title":"Pause or resume a phone's install queue","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/app-store/queue/pause","href":"/api/endpoints/apps/pause-or-resume-a-phones-install-queue"}]},{"group":"Runs","pages":[{"title":"Get a short-lived URL for one archived frame","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/frames/{frameId}","href":"/api/endpoints/runs/get-a-short-lived-url-for-one-archived-frame"},{"title":"List your runs","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/runs","href":"/api/endpoints/runs/list-your-runs"},{"title":"Start a run on a device","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/runs","href":"/api/endpoints/runs/start-a-run-on-a-device"},{"title":"Read a run, optionally waiting for it to move","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/runs/{runId}","href":"/api/endpoints/runs/read-a-run-optionally-waiting-for-it-to-move"},{"title":"Put a run on hold","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/runs/{runId}/pause","href":"/api/endpoints/runs/put-a-run-on-hold"},{"title":"Lift a stop and let the run carry on","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/runs/{runId}/resume","href":"/api/endpoints/runs/lift-a-stop-and-let-the-run-carry-on"},{"title":"Cancel a run","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/runs/{runId}/cancel","href":"/api/endpoints/runs/cancel-a-run"}]},{"group":"Discovery","pages":[{"title":"Discover where to authenticate","deprecated":null,"version":null,"openapi":"/api/openapi.json get /.well-known/oauth-protected-resource","href":"/api/endpoints/discovery/discover-where-to-authenticate"},{"title":"Discover where to authenticate, at the endpoint suffixed path","deprecated":null,"version":null,"openapi":"/api/openapi.json get /.well-known/oauth-protected-resource/mcp","href":"/api/endpoints/discovery/discover-where-to-authenticate-at-the-endpoint-suffixed-path"}]},{"group":"API keys","pages":[{"title":"List the org's keys","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/api-keys","href":"/api/endpoints/api-keys/list-the-orgs-keys"},{"title":"Mint an API key","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/api-keys","href":"/api/endpoints/api-keys/mint-an-api-key"},{"title":"Describe the calling key","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/api-keys/current","href":"/api/endpoints/api-keys/describe-the-calling-key"},{"title":"Revoke the calling key","deprecated":null,"version":null,"openapi":"/api/openapi.json delete /v1/api-keys/current","href":"/api/endpoints/api-keys/revoke-the-calling-key"},{"title":"Revoke a key","deprecated":null,"version":null,"openapi":"/api/openapi.json delete /v1/api-keys/{id}","href":"/api/endpoints/api-keys/revoke-a-key"},{"title":"Rename, renew or narrow a key","deprecated":null,"version":null,"openapi":"/api/openapi.json patch /v1/api-keys/{id}","href":"/api/endpoints/api-keys/rename-renew-or-narrow-a-key"},{"title":"Rotate a key","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/api-keys/{id}/rotate","href":"/api/endpoints/api-keys/rotate-a-key"},{"title":"Start a CLI sign-in","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/cli-sessions","href":"/api/endpoints/api-keys/start-a-cli-sign-in"},{"title":"Poll a CLI sign-in, and collect its key","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/cli-sessions/token","href":"/api/endpoints/api-keys/poll-a-cli-sign-in-and-collect-its-key"},{"title":"Look at a CLI sign-in before approving it","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/cli-sessions/{userCode}","href":"/api/endpoints/api-keys/look-at-a-cli-sign-in-before-approving-it"},{"title":"Approve a CLI sign-in","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/cli-sessions/{userCode}/approve","href":"/api/endpoints/api-keys/approve-a-cli-sign-in"},{"title":"Deny a CLI sign-in","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/cli-sessions/{userCode}/deny","href":"/api/endpoints/api-keys/deny-a-cli-sign-in"}]},{"group":"Usage","pages":[{"title":"List your org's receipts","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/receipts","href":"/api/endpoints/usage/list-your-orgs-receipts"},{"title":"Read one receipt","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/receipts/{idempotencyKey}","href":"/api/endpoints/usage/read-one-receipt"},{"title":"Mark a receipt reviewed","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/receipts/{idempotencyKey}/reviewed","href":"/api/endpoints/usage/mark-a-receipt-reviewed"},{"title":"List a phone's unclear actions","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/devices/{deviceId}/unclear-actions","href":"/api/endpoints/usage/list-a-phones-unclear-actions"},{"title":"Confirm a phone looks right","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/unclear-actions/confirm","href":"/api/endpoints/usage/confirm-a-phone-looks-right"},{"title":"Read your org's usage this period","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/usage","href":"/api/endpoints/usage/read-your-orgs-usage-this-period"}]},{"group":"Devices","pages":[{"title":"Small pictures of several devices' screens","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/device-thumbnails","href":"/api/endpoints/devices/small-pictures-of-several-devices-screens"},{"title":"List the devices you can see","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/devices","href":"/api/endpoints/devices/list-the-devices-you-can-see"},{"title":"Read one device","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/devices/{deviceId}","href":"/api/endpoints/devices/read-one-device"},{"title":"Rename a device","deprecated":null,"version":null,"openapi":"/api/openapi.json patch /v1/devices/{deviceId}","href":"/api/endpoints/devices/rename-a-device"},{"title":"Look at a device's screen","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/devices/{deviceId}/screenshot","href":"/api/endpoints/devices/look-at-a-devices-screen"},{"title":"Live video fault observation","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/image-maintenance/fault","href":"/api/endpoints/devices/live-video-fault-observation"},{"title":"Saved recovery plan cancellation","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/image-maintenance/cancel","href":"/api/endpoints/devices/saved-recovery-plan-cancellation"},{"title":"Original recovery result recheck","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/image-maintenance/recheck","href":"/api/endpoints/devices/original-recovery-result-recheck"},{"title":"Image recovery progress and availability","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/devices/{deviceId}/image-maintenance","href":"/api/endpoints/devices/image-recovery-progress-and-availability"},{"title":"Take a device","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/lease","href":"/api/endpoints/devices/take-a-device"},{"title":"Give a device back","deprecated":null,"version":null,"openapi":"/api/openapi.json delete /v1/devices/{deviceId}/lease","href":"/api/endpoints/devices/give-a-device-back"},{"title":"Keep a device longer","deprecated":null,"version":null,"openapi":"/api/openapi.json patch /v1/devices/{deviceId}/lease","href":"/api/endpoints/devices/keep-a-device-longer"},{"title":"Act on a device","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/actions","href":"/api/endpoints/devices/act-on-a-device"},{"title":"Who is driving a device","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/devices/{deviceId}/driving","href":"/api/endpoints/devices/who-is-driving-a-device"},{"title":"Open a live video session on a device","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/live-session","href":"/api/endpoints/devices/open-a-live-video-session-on-a-device"},{"title":"Wake a device's screen","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/wake","href":"/api/endpoints/devices/wake-a-devices-screen"},{"title":"Open a live view of a device","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/devices/{deviceId}/stream","href":"/api/endpoints/devices/open-a-live-view-of-a-device"},{"title":"Read the server's clock","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/time","href":"/api/endpoints/devices/read-the-servers-clock"},{"title":"List the devices your organisation currently holds","description":"The leases your organisation holds right now, among the devices this credential can see. This is what answers \"how many of my devices are in use\"; `GET /v1/devices` answers how many exist and how many are reachable, and the two are different questions.\n\nA DEVICE MISSING FROM THIS LIST IS NOT AVAILABLE TO YOU. It means only that you hold no live lease on it. It may be held by someone else, or your quota may be spent: the acquire call is deliberately unable to tell those apart, and this endpoint does not tell you either. Acquiring is the only thing that answers whether you can acquire.\n\nThe listing can never name a device `GET /v1/devices` would not: leases are looked up for the devices that listing returns, so a key narrowed to a subset of devices sees leases only within that subset.\n\nThe lease id and fencing token are not returned. The id is the credential `release_device` checks, and publishing it to every reader would let one of your runs release another's lease.\n\nOrdered by expiry, soonest first.\n\nHosted deployments only. A local checkout does not mount this route, so calling it there is a 404.","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/leases","href":"/api/endpoints/devices/list-the-devices-your-organisation-currently-holds"}]},{"group":"Copilot","pages":[{"title":"Ask the copilot","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/copilot","href":"/api/endpoints/copilot/ask-the-copilot"},{"title":"Answer a copilot approval","description":"Answer one `approval.request` from an open copilot stream.\n\nIt returns as soon as the answer is recorded and tells you nothing about what happened next, because what happens next appears on the STREAM: `tool.call` then `tool.result` for an allow, `tool.denied` for a deny. A client waiting on this response to render the outcome is waiting for the wrong thing.\n\nOnly the person the question was asked of may answer it, on the same organisation. An id that names nothing, one already answered, one that expired and one belonging to somebody else all answer 404 alike: telling them apart would make this a way to probe other people's outstanding questions.\n\nHosted deployments only. A local checkout does not mount this route, so calling it there is a 404.","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/copilot/approvals","href":"/api/endpoints/copilot/answer-a-copilot-approval"},{"title":"Run one tool the person named","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/copilot/commands","href":"/api/endpoints/copilot/run-one-tool-the-person-named"},{"title":"Stop the turn this thread is running","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/copilot/threads/{id}/stop","href":"/api/endpoints/copilot/stop-the-turn-this-thread-is-running"},{"title":"Pick a cut copilot stream back up","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/copilot/threads/{id}/stream","href":"/api/endpoints/copilot/pick-a-cut-copilot-stream-back-up"},{"title":"Your copilot threads","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/copilot/threads","href":"/api/endpoints/copilot/your-copilot-threads"},{"title":"One thread, with a page of its messages","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/copilot/threads/{id}","href":"/api/endpoints/copilot/one-thread-with-a-page-of-its-messages"},{"title":"Delete a thread","deprecated":null,"version":null,"openapi":"/api/openapi.json delete /v1/copilot/threads/{id}","href":"/api/endpoints/copilot/delete-a-thread"},{"title":"Rename a thread","deprecated":null,"version":null,"openapi":"/api/openapi.json patch /v1/copilot/threads/{id}","href":"/api/endpoints/copilot/rename-a-thread"}]},{"group":"Webhooks","pages":[{"title":"Your webhook subscriptions","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/webhooks","href":"/api/endpoints/webhooks/your-webhook-subscriptions"},{"title":"Subscribe your system to what happens here","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/webhooks","href":"/api/endpoints/webhooks/subscribe-your-system-to-what-happens-here"},{"title":"Remove a subscription","deprecated":null,"version":null,"openapi":"/api/openapi.json delete /v1/webhooks/{webhookId}","href":"/api/endpoints/webhooks/remove-a-subscription"},{"title":"Enable or disable a subscription","deprecated":null,"version":null,"openapi":"/api/openapi.json patch /v1/webhooks/{webhookId}","href":"/api/endpoints/webhooks/enable-or-disable-a-subscription"},{"title":"Replace a signing secret","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/webhooks/{webhookId}/rotate","href":"/api/endpoints/webhooks/replace-a-signing-secret"},{"title":"Send a test delivery","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/webhooks/{webhookId}/test","href":"/api/endpoints/webhooks/send-a-test-delivery"},{"title":"What was delivered, and what happened","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/webhooks/{webhookId}/deliveries","href":"/api/endpoints/webhooks/what-was-delivered-and-what-happened"}]},{"group":"Robot purchases","pages":[{"title":"List your robot purchases","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/robot-purchases","href":"/api/endpoints/robot-purchases/list-your-robot-purchases"},{"title":"Read the monthly robot checkout offer","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/robot-purchases/offer","href":"/api/endpoints/robot-purchases/read-the-monthly-robot-checkout-offer"},{"title":"Open the original monthly robot checkout","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/robot-purchases/checkout","href":"/api/endpoints/robot-purchases/open-the-original-monthly-robot-checkout"},{"title":"Read your initial robot purchase receipt","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/robot-purchases/{orderId}","href":"/api/endpoints/robot-purchases/read-your-initial-robot-purchase-receipt"}]},{"group":"Managed Proxy","pages":[{"title":"Quote a multi-unit Proxy purchase","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-purchase-quotes","href":"/api/endpoints/managed-proxy/quote-a-multi-unit-proxy-purchase"},{"title":"Read the original purchase agreement","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-purchase-quotes/{quoteId}","href":"/api/endpoints/managed-proxy/read-the-original-purchase-agreement"},{"title":"Accept the original multi-unit purchase agreement","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-purchases","href":"/api/endpoints/managed-proxy/accept-the-original-multi-unit-purchase-agreement"},{"title":"Read unit delivery and original payment facts","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-purchases/{purchaseId}","href":"/api/endpoints/managed-proxy/read-unit-delivery-and-original-payment-facts"},{"title":"Cancel original undelivered units","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-purchases/{purchaseId}/cancel","href":"/api/endpoints/managed-proxy/cancel-original-undelivered-units"},{"title":"List managed Proxy products","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-products","href":"/api/endpoints/managed-proxy/list-managed-proxy-products"},{"title":"Read a managed Proxy product","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-products/{productId}","href":"/api/endpoints/managed-proxy/read-a-managed-proxy-product"},{"title":"Quote a managed Proxy purchase","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-quotes","href":"/api/endpoints/managed-proxy/quote-a-managed-proxy-purchase"},{"title":"Read the original quote","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-quotes/{quoteId}","href":"/api/endpoints/managed-proxy/read-the-original-quote"},{"title":"List your Proxy orders","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-orders","href":"/api/endpoints/managed-proxy/list-your-proxy-orders"},{"title":"Reserve a quoted Proxy order","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-orders","href":"/api/endpoints/managed-proxy/reserve-a-quoted-proxy-order"},{"title":"Read a Proxy order and its settlement","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-orders/{orderId}","href":"/api/endpoints/managed-proxy/read-a-proxy-order-and-its-settlement"},{"title":"Request hosted Checkout for an order","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-orders/{orderId}/checkout","href":"/api/endpoints/managed-proxy/request-hosted-checkout-for-an-order"},{"title":"Cancel a Proxy order","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-orders/{orderId}/cancel","href":"/api/endpoints/managed-proxy/cancel-a-proxy-order"},{"title":"List your managed Proxies","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxies","href":"/api/endpoints/managed-proxy/list-your-managed-proxies"},{"title":"Read a managed Proxy","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxies/{proxyId}","href":"/api/endpoints/managed-proxy/read-a-managed-proxy"},{"title":"Rename a managed Proxy","deprecated":null,"version":null,"openapi":"/api/openapi.json patch /v1/proxies/{proxyId}","href":"/api/endpoints/managed-proxy/rename-a-managed-proxy"},{"title":"Archive an expired detached Proxy","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxies/{proxyId}/archive","href":"/api/endpoints/managed-proxy/archive-an-expired-detached-proxy"},{"title":"List your Proxy network operations","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-operations","href":"/api/endpoints/managed-proxy/list-your-proxy-network-operations"},{"title":"Connect or disconnect a Proxy","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/proxy-operations","href":"/api/endpoints/managed-proxy/connect-or-disconnect-a-proxy"},{"title":"Read a Proxy operation","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/proxy-operations/{operationId}","href":"/api/endpoints/managed-proxy/read-a-proxy-operation"},{"title":"Read a device's confirmed Proxy relationship","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/devices/{deviceId}/proxy","href":"/api/endpoints/managed-proxy/read-a-devices-confirmed-proxy-relationship"}]},{"group":"Minute billing","pages":[{"title":"/v1/minute/requests/:requestId","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/requests/{requestId}","href":"/api/endpoints/minute-billing/v1minuterequests:requestid"},{"title":"/v1/minute/catalog","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/catalog","href":"/api/endpoints/minute-billing/v1minutecatalog"},{"title":"/v1/minute/wallet","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/wallet","href":"/api/endpoints/minute-billing/v1minutewallet"},{"title":"/v1/minute/topup-quotes","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/topup-quotes","href":"/api/endpoints/minute-billing/v1minutetopup-quotes"},{"title":"/v1/minute/topups","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/topups","href":"/api/endpoints/minute-billing/v1minutetopups"},{"title":"/v1/minute/topups/:id","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/topups/{id}","href":"/api/endpoints/minute-billing/v1minutetopups:id"},{"title":"/v1/minute/topups/:id/abandon","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/topups/{id}/abandon","href":"/api/endpoints/minute-billing/v1minutetopups:idabandon"},{"title":"/v1/minute/starts","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/starts","href":"/api/endpoints/minute-billing/v1minutestarts"},{"title":"/v1/minute/starts/:id","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/starts/{id}","href":"/api/endpoints/minute-billing/v1minutestarts:id"},{"title":"/v1/minute/orders","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/orders","href":"/api/endpoints/minute-billing/v1minuteorders"},{"title":"/v1/minute/orders","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/orders","href":"/api/endpoints/minute-billing/v1minuteorders-1"},{"title":"/v1/minute/orders/:id","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/orders/{id}","href":"/api/endpoints/minute-billing/v1minuteorders:id"},{"title":"/v1/minute/orders/:id/cancel","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/orders/{id}/cancel","href":"/api/endpoints/minute-billing/v1minuteorders:idcancel"},{"title":"/v1/minute/rentals/:deviceId","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/rentals/{deviceId}","href":"/api/endpoints/minute-billing/v1minuterentals:deviceid"},{"title":"/v1/minute/rentals/:deviceId/return","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/rentals/{deviceId}/return","href":"/api/endpoints/minute-billing/v1minuterentals:deviceidreturn"},{"title":"/v1/minute/rentals/:deviceId/resume","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/rentals/{deviceId}/resume","href":"/api/endpoints/minute-billing/v1minuterentals:deviceidresume"},{"title":"/v1/minute/refunds","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/refunds","href":"/api/endpoints/minute-billing/v1minuterefunds"},{"title":"/v1/minute/refunds","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/refunds","href":"/api/endpoints/minute-billing/v1minuterefunds-1"},{"title":"/v1/minute/cases","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/cases","href":"/api/endpoints/minute-billing/v1minutecases"},{"title":"/v1/minute/cases","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/minute/cases","href":"/api/endpoints/minute-billing/v1minutecases-1"},{"title":"/v1/minute/cases/:id","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/cases/{id}","href":"/api/endpoints/minute-billing/v1minutecases:id"},{"title":"/v1/minute/refunds/:id","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/minute/refunds/{id}","href":"/api/endpoints/minute-billing/v1minuterefunds:id"}]},{"group":"Provisioning","pages":[{"title":"Check whether your organisation is provisioned","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/admission","href":"/api/endpoints/provisioning/check-whether-your-organisation-is-provisioned"},{"title":"What your organisation has bought, and where each purchase got to","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/fulfilments","href":"/api/endpoints/provisioning/what-your-organisation-has-bought-and-where-each-purchase-got-to"},{"title":"Whether one checkout was paid","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/orders/{orderId}/payment-status","href":"/api/endpoints/provisioning/whether-one-checkout-was-paid"},{"title":"Cancelling online is retired: contact support","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/fulfilments/{id}/cancel","href":"/api/endpoints/provisioning/cancelling-online-is-retired:-contact-support"},{"title":"Returning online is retired: contact support","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/fulfilments/{id}/return","href":"/api/endpoints/provisioning/returning-online-is-retired:-contact-support"},{"title":"Stop future Cloud phone renewal at Stripe's current period end","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/fulfilments/{id}/cancel-renewal","href":"/api/endpoints/provisioning/stop-future-cloud-phone-renewal-at-stripes-current-period-end"},{"title":"Read a Cloud phone's current monthly renewal state","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/fulfilments/{id}/renewal-status","href":"/api/endpoints/provisioning/read-a-cloud-phones-current-monthly-renewal-state"},{"title":"What you owe next","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/billing/upcoming","href":"/api/endpoints/provisioning/what-you-owe-next"},{"title":"Open the billing portal","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/billing/portal-sessions","href":"/api/endpoints/provisioning/open-the-billing-portal"},{"title":"List what can be bought and what it costs","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/skus","href":"/api/endpoints/provisioning/list-what-can-be-bought-and-what-it-costs"},{"title":"Start provisioning this organisation","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/checkout-sessions","href":"/api/endpoints/provisioning/start-provisioning-this-organisation"},{"title":"Check one returned Checkout now","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/checkout-sessions/{orderId}/confirm","href":"/api/endpoints/provisioning/check-one-returned-checkout-now"},{"title":"Where the payment provider delivers","deprecated":null,"version":null,"openapi":"/api/openapi.json post /webhooks/stripe","href":"/api/endpoints/provisioning/where-the-payment-provider-delivers"},{"title":"Where the identity provider delivers","deprecated":null,"version":null,"openapi":"/api/openapi.json post /webhooks/clerk","href":"/api/endpoints/provisioning/where-the-identity-provider-delivers"}]},{"group":"Notifications","pages":[{"title":"The bell, and the list behind it","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/notifications","href":"/api/endpoints/notifications/the-bell-and-the-list-behind-it"},{"title":"Mark notifications read","deprecated":null,"version":null,"openapi":"/api/openapi.json post /v1/notifications/read","href":"/api/endpoints/notifications/mark-notifications-read"},{"title":"Which emails you receive","deprecated":null,"version":null,"openapi":"/api/openapi.json get /v1/me/notification-preferences","href":"/api/endpoints/notifications/which-emails-you-receive"},{"title":"Change which emails you receive","deprecated":null,"version":null,"openapi":"/api/openapi.json patch /v1/me/notification-preferences","href":"/api/endpoints/notifications/change-which-emails-you-receive"}]}]}]},{"tab":"Help","pages":[{"title":"Help","href":"/help/overview"}]}]},"basePath":"","title":"Ask the copilot - PhoneUse","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BtG4DSkw.js","snippetPresets-C1k1xDhp.js","utils-PMJoEt4Y.js","style-to-object-BY3JEAdk.js","utils-DW3Pr7Jq.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DIISLO2w.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BErNCZCm.js","_Uint8Array-f0PCu9f_.js","isObject-FP1Yky1u.js","ApiExamples-OjY-8mqu.js","usePlaygroundInputsStore-B2HS2hUb.js","shallow-DVFuuIDQ.js","isEqual-DG0UKiQC.js","CodeSnippets-Cy6FBgwN.js","CodeSnippet-D1PtG8ed.js","getApiPlaygroundDisplay-Dkx2eNtL.js","Page-C8Cg25if.js","DynamicMarkdown-BvJIe00T.js","SectionHeading-B0rKYV8d.js","icon-yclzBff4.js","MethodPill-DxA11cCF.js","getPastedJson-CpkIDpMk.js","DuplicateIcon-CFCQNJ-D.js","axios-CsQoIw0U.js","Markdown-CK5C-fmV.js","AssistantPageLink-Cw134Dd-.js","dist-3xM3Qrc7.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}