diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index e1d71f5c..72c2d750 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -13034,6 +13034,47 @@ components: - 'content' - 'role' type: 'object' + InternInvokeAcceptedResponse: + description: 'The intern admitted the prompt. The run continues on the intern.' + example: + session_id: 'b51a0e21-368b-4780-a220-14655bf28c55' + status: 'started' + properties: + session_id: + description: 'The session the run belongs to. Send it back to continue the conversation.' + example: 'b51a0e21-368b-4780-a220-14655bf28c55' + type: 'string' + status: + description: '`started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead.' + enum: + - 'started' + - 'steered' + example: 'started' + type: 'string' + required: + - 'session_id' + - 'status' + type: 'object' + InternInvokeRequest: + description: 'A prompt to run on the intern without holding a connection open.' + example: + input: 'New support ticket 48213. Case token: ct_9f2c. Investigate and reply.' + properties: + input: + description: 'The prompt for the run, at most 32000 characters.' + example: 'New support ticket 48213. Case token: ct_9f2c. Investigate and reply.' + maxLength: 32000 + minLength: 1 + type: 'string' + session_id: + description: 'The session to run in. Send the `session_id` from an earlier `202` to continue that conversation, for example to hand the intern a decision on a case it is working. Omit it to start a new session. Only a `session_id` this endpoint issued to the same caller on the same intern is accepted; any other is refused with `404`.' + example: 'b51a0e21-368b-4780-a220-14655bf28c55' + maxLength: 256 + minLength: 1 + type: 'string' + required: + - 'input' + type: 'object' InternLifecycleError: additionalProperties: false description: 'Intern lifecycle request failure.' @@ -37235,6 +37276,213 @@ paths: - 'Interns' x-speakeasy-group: 'interns' x-speakeasy-name-override: 'chat' + /interns/{internId}/invoke: + post: + description: "Starts a run on one of your interns and answers `202` with the `session_id` as soon as the intern accepts it. The run keeps going on the intern after the response. Nothing about its progress comes back on this request; the intern reports through its own tools, such as Slack.\n\nSend the same `session_id` later to continue the conversation, for example to hand the intern a decision on work it started. If that session already has a run going, the prompt is delivered into it and the status is `steered`. A `session_id` is accepted only from the caller it was issued to, on the same intern; any other, including sessions started from Slack or the chat endpoint, is refused with `404`.\n\nRuns started here self-drive: the intern consents to its own tool approvals, and a question it asks is answered by its own fallback. A run ends when the intern finishes it or after its execution deadline (1 hour by default).\n\nAvailable to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`." + operationId: 'invokeIntern' + parameters: + - description: 'The intern to run.' + in: 'path' + name: 'internId' + required: true + schema: + description: 'The intern to run.' + example: 'a11e0000-0000-4000-8000-000000000005' + type: 'string' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/InternInvokeRequest' + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/InternInvokeAcceptedResponse' + description: 'The intern accepted the prompt. The run continues on the intern.' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid invoke request (input: Too small: expected string to have >=1 characters).' + metadata: + reason: 'bad_request' + retryable: false + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The body is not a valid request (`bad_request`).' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Invalid or missing API key' + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'No valid API key.' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'This API key''s creator is no longer a member of the organization. Ask an organization admin to reassign the key to an active member.' + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The key belongs to a member who has left the organization and holds no grant.' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Intern not found' + metadata: + reason: 'not_found' + retryable: false + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The caller is outside the interns programme, the intern does not exist for this key, or the `session_id` was not issued to this caller on this intern (`not_found`).' + '408': + content: + application/json: + example: + error: + code: 408 + message: 'Operation timed out after 60s. Please try again later.' + metadata: + reason: 'timeout' + retryable: true + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The request exceeded the route''s own deadline before the handler answered (`timeout`).' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'This intern is not running.' + metadata: + reason: 'intern_not_ready' + retryable: true + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The intern is not running or its runtime is too old to keep a run going without a connection (`intern_not_ready`), or the session already has a run that did not take the prompt (`busy`). A `busy` refusal carries `Retry-After`.' + headers: + Retry-After: + description: 'Seconds to wait before retrying this request. Present only on a `busy` refusal.' + required: false + schema: + description: 'Seconds to wait before retrying this request. Present only on a `busy` refusal.' + example: '5' + type: 'string' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request body exceeds 1048576 bytes' + metadata: + reason: 'payload_too_large' + retryable: false + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The body exceeds 1 MiB (`payload_too_large`).' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Too many intern turns. Please wait a moment.' + metadata: + reason: 'rate_limited' + retryable: true + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'Too many turns for the user or organization this key acts as (`rate_limited`). It carries `Retry-After`.' + headers: + Retry-After: + description: 'Seconds to wait before retrying this request.' + required: true + schema: + description: 'Seconds to wait before retrying this request.' + example: '60' + type: 'string' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Could not look up the intern' + metadata: + reason: 'intern_unreachable' + retryable: true + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The intern could not be looked up, or authenticating the key failed.' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'The intern could not be reached.' + metadata: + reason: 'intern_unreachable' + retryable: true + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The intern could not be reached, rejected the request, or refused the turn before it started.' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'The intern cannot hold another run open across a question right now. Retry later.' + metadata: + reason: 'busy' + retryable: true + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The intern cannot take another run right now (`busy`). It reports `retryable: true` and carries `Retry-After`.' + headers: + Retry-After: + description: 'Seconds to wait before retrying this request.' + required: true + schema: + description: 'Seconds to wait before retrying this request.' + example: '5' + type: 'string' + '504': + content: + application/json: + example: + error: + code: 504 + message: 'The intern did not answer in time.' + metadata: + reason: 'timeout' + retryable: true + schema: + $ref: '#/components/schemas/InternChatErrorResponse' + description: 'The intern did not accept the turn in time (`timeout`).' + security: + - apiKey: [] + summary: 'Start an intern run without waiting for it' + tags: + - 'Interns' + x-speakeasy-group: 'interns' + x-speakeasy-name-override: 'invoke' /interns/{internId}/provision: post: description: 'Starts the first boot, or resumes an intern after suspension. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.'