List AI Gateway sessions
GET
Alias: also available at /api/v2/aibridge/sessions for backward compatibility.
CoderSessionTokenheader
Coder-Session-Token<token>q?stringSearch query in the format key:value. Available keys are: initiator, provider, provider_name, model, client, session_id, started_after, started_before.
limit?integerPage limit
after_session_id?stringCursor pagination after session ID (cannot be used with offset)
offset?integerOffset pagination (cannot be used with after_session_id)
OK
application/json- response
count?integersessions?array<>The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X GET \ "$CODER_URL/api/v2/ai-gateway/sessions" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN"Example Response200
{ "count": 0, "sessions": [ { "client": "string", "ended_at": "2019-08-24T14:15:22Z", "id": "string", "initiator": { "avatar_url": "http://example.com", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "username": "string" }, "last_active_at": "2019-08-24T14:15:22Z", "last_prompt": "string", "metadata": { "property1": null, "property2": null }, "models": [ "string" ], "network_calls": { "blocked": 0, "total": 0 }, "providers": [ "string" ], "started_at": "2019-08-24T14:15:22Z", "threads": 0, "token_usage_summary": { "cache_read_input_tokens": 0, "cache_write_input_tokens": 0, "input_tokens": 0, "output_tokens": 0 } } ]}