> ## Documentation Index
> Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Session

> Create a persisted agent session owned by the requesting user.



## OpenAPI

````yaml post /v1/agent_sessions
openapi: 3.1.0
info:
  title: Arize-Phoenix REST API
  description: Schema for Arize-Phoenix REST API
  version: '1.0'
servers: []
security: []
paths:
  /v1/agent_sessions:
    post:
      tags:
        - chat
      summary: Create Session
      description: Create a persisted agent session owned by the requesting user.
      operationId: createAgentSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentSessionRequestBody'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAgentSessionResponseBody'
        '400':
          content:
            text/plain:
              schema:
                type: string
          description: Bad Request
        '401':
          content:
            text/plain:
              schema:
                type: string
          description: Unauthorized
        '403':
          content:
            text/plain:
              schema:
                type: string
          description: Forbidden
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Not Found
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: Unprocessable Entity
        '507':
          content:
            text/plain:
              schema:
                type: string
          description: Insufficient Storage
components:
  schemas:
    CreateAgentSessionRequestBody:
      properties:
        model:
          $ref: '#/components/schemas/AgentModelSelection'
        title:
          type: string
          maxLength: 100
          title: Title
          description: Optional initial title.
          default: ''
        is_ephemeral:
          type: boolean
          title: Is Ephemeral
          description: Whether the session should expire after a period of inactivity.
          default: false
      type: object
      required:
        - model
      title: CreateAgentSessionRequestBody
      description: Request body for creating a persisted agent session.
    CreateAgentSessionResponseBody:
      properties:
        data:
          $ref: '#/components/schemas/CreatedAgentSession'
      type: object
      required:
        - data
      title: CreateAgentSessionResponseBody
    AgentModelSelection:
      oneOf:
        - $ref: '#/components/schemas/CustomProviderModelSelection'
        - $ref: '#/components/schemas/BuiltInProviderModelSelection'
      discriminator:
        propertyName: providerType
        mapping:
          builtin:
            $ref: '#/components/schemas/BuiltInProviderModelSelection'
          custom:
            $ref: '#/components/schemas/CustomProviderModelSelection'
    CreatedAgentSession:
      properties:
        id:
          type: string
          title: Id
          description: The session's GlobalID — the ``session_id`` the chat route expects.
      type: object
      required:
        - id
      title: CreatedAgentSession
    CustomProviderModelSelection:
      properties:
        providerType:
          type: string
          const: custom
          title: Providertype
        providerId:
          type: string
          title: Providerid
        modelName:
          type: string
          title: Modelname
      type: object
      required:
        - providerType
        - providerId
        - modelName
      title: CustomProviderModelSelection
      description: Chat against a stored custom provider record.
    BuiltInProviderModelSelection:
      properties:
        providerType:
          type: string
          const: builtin
          title: Providertype
        provider:
          $ref: '#/components/schemas/ModelProvider'
        modelName:
          type: string
          title: Modelname
      type: object
      required:
        - providerType
        - provider
        - modelName
      title: BuiltInProviderModelSelection
      description: |-
        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.
    ModelProvider:
      type: string
      enum:
        - OPENAI
        - AZURE_OPENAI
        - ANTHROPIC
        - GOOGLE
        - DEEPSEEK
        - XAI
        - OLLAMA
        - AWS
        - CEREBRAS
        - FIREWORKS
        - GROQ
        - MOONSHOT
        - PERPLEXITY
        - TOGETHER
      title: ModelProvider

````