Skip to main content
The Interactions API is currently in Beta. Features and API signatures may change.

Method

Retrieves the full details of a single interaction based on its ID. Can optionally stream the response or resume from a specific event.
string
required
The unique identifier of the interaction to retrieve
boolean
default:"false"
If true, the generated content will be streamed incrementally. Returns Stream[InteractionSSEEvent] instead of Interaction.
boolean
default:"false"
If true, includes the original input in the response
string
Optional. If set, resumes the interaction stream from the next chunk after the event marked by this ID. Can only be used if stream is true.

Response

string
Unique identifier for the interaction
string
The model used for the interaction
Input
The input provided (only if include_input=True)
Output
The generated output from the model
string
State of the interaction:
  • PENDING: Waiting to start
  • RUNNING: Currently processing
  • COMPLETED: Finished successfully
  • FAILED: Encountered an error
  • CANCELLED: Cancelled by user
string
ISO 8601 timestamp when the interaction was created
string
ISO 8601 timestamp of the last update
object
Token usage statistics
string
ID of the previous interaction in the chain (if any)

Usage

Retrieve an Interaction

Include Original Input

Stream Retrieved Interaction

Resume Streaming from Event

Monitor Background Interaction

Check Usage Statistics

Handle Different States

Retrieve Interaction Chain

Error Handling

Compare Interaction Timing

Notes

  • Only stored interactions can be retrieved (created with store=True)
  • Streaming a retrieved interaction replays or continues the response
  • Use last_event_id to resume interrupted streams
  • Background interactions can be polled until completion
  • Token usage is available after interaction completes

Streaming Behavior

When stream=True:
  • If the interaction is complete, the full response is streamed
  • If the interaction is in progress, streaming continues from the current position
  • Use last_event_id to resume from a specific point
  • Each event has a unique ID for resumption

See Also