Ask a question
const url = 'https://example.com/api/v1/ai/ask';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"provider":"claude","question":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/ai/ask \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "provider": "claude", "question": "example" }'Start a read-only Ask turn for the caller with the selected AI provider. The server searches data the caller can read and returns the new turn ID and status. Route: /api/v1/ai/ask. Inputs: . Do not automatically replay this operation after an uncertain result.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Configured official Agent provider used for the read-only turn.
Question to answer from data visible to this User.
Responses
Section titled “Responses”object
Files, Notes and Tasks writes made with this turn’s token, newest first.
One attributed write. The item ID is the stable identity for /f/<item-id>.
object
Previous path for a move.
Files change-feed operation: create, write, move or trash.
Home-relative path right after the change.
Stable failure or cancellation reason, for example credential_removed.
Unix time in milliseconds when the turn reached a final state.
The server-side turn policy. Ask turns get a token with a read-only scope.
The User’s request as it was sent, without the server’s framing.
The official coding Agent selected by a prompt mention.
queued, running, completed, failed, cancelled, undoing or undone.
Example
{ "kind": "agent", "provider": "claude"}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}