Skip to main content
POST
Requires version 2.0.1 or later of the Archetype platform.

Overview

A session answers the same three request formats as the Inference API, under the session’s own path. The model uses the session’s values and state. Each takes the same body and returns the same response as its endpoint without a session. A model answers only the formats it serves: see Available Models. To use an OpenAI SDK with a session, set its base URL to https://platform.u1.archetypeai.app/api/inference/sessions/{session_id}.

Request

string
required
Session ses_ ID, from Create Model Session.
The body is the request body of Direct Query, Chat Completions, or Responses, matching the path.
string
required
The session’s model, by any of its names. A body without model, or one that names a different model than the session’s, returns 400.

Important Notes

  • 409 with session_not_running means the session has ended. Open a new session and send the query there. You don’t need to read the session’s error first.
  • 404 means the session doesn’t exist or isn’t visible to you.
  • 400 also means model is missing or names a different model than the session’s.
  • A 503 doesn’t mean the session has ended. Retry.
  • Every other error is the same as on the endpoint without a session. See Errors.