---
title: "Create Session"
method: POST
path: "/v1/agent_sessions"
tags: ["chat"]
---

# Create Session

`POST /v1/agent_sessions`

Create a persisted agent session owned by the requesting user.

## Request body

- CreateAgentSessionRequestBody — Request body for creating a persisted agent session.
  - `model` union, required
    - CustomProviderModelSelection — Chat against a stored custom provider record.
      - `providerType` 'custom', required
      - `providerId` string, required
      - `modelName` string, required
    - BuiltInProviderModelSelection — Chat against a Phoenix built-in provider. Credentials and connection details (base URL, Azure endpoint, AWS region) are resolved from the secret store first and the process environment second.
      - `providerType` 'builtin', required
      - `provider` 'OPENAI' | 'AZURE_OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'DEEPSEEK' | 'XAI' | 'OLLAMA' | 'AWS' | 'CEREBRAS' | 'FIREWORKS' | 'GROQ' | 'MOONSHOT' | 'PERPLEXITY' | 'TOGETHER', required
      - `modelName` string, required
  - `title` string — Optional initial title.
  - `is_ephemeral` boolean — Whether the session should expire after a period of inactivity.

## Response `201`

Successful Response

- CreateAgentSessionResponseBody
  - `data` CreatedAgentSession, required
    - `id` string, required — The session's GlobalID — the ``session_id`` the chat route expects.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Entity
- `507` — Insufficient Storage

---

[API](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api.md) · [All operations](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/arize-ai/arize-phoenix-rest-api/revisions/8ac3f55fbe00/schema)
