> ## Documentation Index
> Fetch the complete documentation index at: https://docs.julep.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Session



## OpenAPI

````yaml https://api.julep.ai/api/openapi.json post /sessions
openapi: 3.1.0
info:
  title: Julep Agents API
  description: API for Julep Agents
  termsOfService: https://www.julep.ai/terms
  contact:
    name: Julep
    url: https://www.julep.ai/
    email: developers@julep.ai
  version: 0.4.0
servers:
  - url: /api
security: []
paths:
  /sessions:
    post:
      tags:
        - sessions
      summary: Create Session
      operationId: create_session_sessions_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSessionRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CreateSessionRequest:
      properties:
        user:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User
        users:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Users
        agent:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Agent
        agents:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Agents
        situation:
          anyOf:
            - type: string
            - type: 'null'
          title: Situation
        system_template:
          anyOf:
            - type: string
            - type: 'null'
          title: System Template
        render_templates:
          type: boolean
          title: Render Templates
          default: true
        token_budget:
          anyOf:
            - type: integer
            - type: 'null'
          title: Token Budget
        context_overflow:
          anyOf:
            - type: string
              enum:
                - truncate
                - adaptive
            - type: 'null'
          title: Context Overflow
        auto_run_tools:
          type: boolean
          title: Auto Run Tools
          default: false
        forward_tool_calls:
          type: boolean
          title: Forward Tool Calls
          default: false
        recall_options:
          anyOf:
            - $ref: '#/components/schemas/VectorDocSearch'
            - $ref: '#/components/schemas/TextOnlyDocSearch'
            - $ref: '#/components/schemas/HybridDocSearch'
            - type: 'null'
          title: Recall Options
        metadata:
          anyOf:
            - type: object
            - type: 'null'
          title: Metadata
      type: object
      title: CreateSessionRequest
      description: Payload for creating a session
    Session:
      properties:
        situation:
          anyOf:
            - type: string
            - type: 'null'
          title: Situation
        system_template:
          anyOf:
            - type: string
            - type: 'null'
          title: System Template
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
          readOnly: true
        render_templates:
          type: boolean
          title: Render Templates
          default: true
        token_budget:
          anyOf:
            - type: integer
            - type: 'null'
          title: Token Budget
        context_overflow:
          anyOf:
            - type: string
              enum:
                - truncate
                - adaptive
            - type: 'null'
          title: Context Overflow
        auto_run_tools:
          type: boolean
          title: Auto Run Tools
          default: false
        forward_tool_calls:
          type: boolean
          title: Forward Tool Calls
          default: false
        recall_options:
          anyOf:
            - $ref: '#/components/schemas/VectorDocSearch'
            - $ref: '#/components/schemas/TextOnlyDocSearch'
            - $ref: '#/components/schemas/HybridDocSearch'
            - type: 'null'
          title: Recall Options
        id:
          type: string
          format: uuid
          title: Id
          readOnly: true
        metadata:
          anyOf:
            - type: object
            - type: 'null'
          title: Metadata
        created_at:
          type: string
          format: date-time
          title: Created At
          readOnly: true
        updated_at:
          type: string
          format: date-time
          title: Updated At
          readOnly: true
        kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Kind
      type: object
      required:
        - id
        - created_at
        - updated_at
      title: Session
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VectorDocSearch:
      properties:
        limit:
          type: integer
          maximum: 50
          minimum: 1
          title: Limit
          default: 10
        lang:
          type: string
          title: Lang
          default: en-US
        metadata_filter:
          type: object
          title: Metadata Filter
          default: {}
        num_search_messages:
          type: integer
          maximum: 50
          minimum: 1
          title: Num Search Messages
          default: 4
        max_query_length:
          type: integer
          maximum: 10000
          minimum: 100
          title: Max Query Length
          default: 1000
        include_embeddings:
          type: boolean
          title: Include Embeddings
          default: true
        mode:
          type: string
          const: vector
          title: Mode
          default: vector
        confidence:
          type: number
          maximum: 1
          minimum: -1
          title: Confidence
          default: 0.5
        mmr_strength:
          type: number
          exclusiveMaximum: 1
          minimum: 0
          title: Mmr Strength
          default: 0.5
      type: object
      title: VectorDocSearch
    TextOnlyDocSearch:
      properties:
        limit:
          type: integer
          maximum: 50
          minimum: 1
          title: Limit
          default: 10
        lang:
          type: string
          title: Lang
          default: en-US
        metadata_filter:
          type: object
          title: Metadata Filter
          default: {}
        num_search_messages:
          type: integer
          maximum: 50
          minimum: 1
          title: Num Search Messages
          default: 4
        max_query_length:
          type: integer
          maximum: 10000
          minimum: 100
          title: Max Query Length
          default: 1000
        include_embeddings:
          type: boolean
          title: Include Embeddings
          default: true
        mode:
          type: string
          const: text
          title: Mode
          default: text
        trigram_similarity_threshold:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Trigram Similarity Threshold
      type: object
      title: TextOnlyDocSearch
    HybridDocSearch:
      properties:
        limit:
          type: integer
          maximum: 50
          minimum: 1
          title: Limit
          default: 10
        lang:
          type: string
          title: Lang
          default: en-US
        metadata_filter:
          type: object
          title: Metadata Filter
          default: {}
        num_search_messages:
          type: integer
          maximum: 50
          minimum: 1
          title: Num Search Messages
          default: 4
        max_query_length:
          type: integer
          maximum: 10000
          minimum: 100
          title: Max Query Length
          default: 1000
        include_embeddings:
          type: boolean
          title: Include Embeddings
          default: true
        mode:
          type: string
          const: hybrid
          title: Mode
          default: hybrid
        confidence:
          type: number
          maximum: 1
          minimum: -1
          title: Confidence
          default: 0.5
        alpha:
          type: number
          maximum: 1
          minimum: 0
          title: Alpha
          default: 0.5
        mmr_strength:
          type: number
          exclusiveMaximum: 1
          minimum: 0
          title: Mmr Strength
          default: 0.5
        trigram_similarity_threshold:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Trigram Similarity Threshold
        k_multiplier:
          type: integer
          minimum: 0
          title: K Multiplier
          default: 7
      type: object
      title: HybridDocSearch
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization

````