Run and Run Step API
Runs are processes that execute the assistantβs logic within a thread, allowing it to process messages, generate responses, and call external tools if needed. Runs go through different statuses, such as queued, in_progress, and completed, and trigger events based on their progress, including tool calls and message updates.
This page provides API schemas for the following methods:
https://api.apilaplas.com/threads/{threadId}/runs
https://api.apilaplas.com/threads/runs
https://api.apilaplas.com/threads/{threadId}/runs
https://api.apilaplas.com/threads/{threadId}/runs/{runId}
https://api.apilaplas.com/threads/{threadId}/runs/{runId}
https://api.apilaplas.com/threads/{threadId}/runs/{runId}/submit_tool_outputs
https://api.apilaplas.com/threads/{threadId}/runs/{runId}/cancel
https://api.apilaplas.com/threads/{threadId}/runs/{runId}/steps
https://api.apilaplas.com/threads/{threadId}/runs/{runId}/steps/{stepId}
After each schema, you'll find a short example demonstrating how to correctly call the described method in code using the OpenAI SDK.
Note that the method names in the API schema and the SDK often differ. Accordingly, when calling these methods via the REST API, you should use the names from the API schema, while for calls through the OpenAI SDK, use the names from the examples.
API Schemas
Create a run
Python + OpenAI SDK Example:
Create a Thread and run it in one request
Python + OpenAI SDK Example:
Retrieve a list of Runs belonging to a specific Thread
Python + OpenAI SDK Example:
Retrieve information about a specific Run by its ID
Python + OpenAI SDK Example:
Modify a specific run by its ID
Python + OpenAI SDK Example:
Submit Tool outputs to a specific Run
Python + OpenAI SDK Example:
Cancel a specific Run by its ID
Python + OpenAI SDK Example:
Retrieve a list of Run Steps belonging to a specific Run
Python + OpenAI SDK Example:
Retrieve information about a specific Run Step by its ID
Python + OpenAI SDK Example:
Last updated