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

# Start a new session (deprecated)

> Deprecated. Use `POST /v1/sessions` instead. The legacy route wraps the session object under a `session` key; the v1 route accepts a bare session object.




## OpenAPI

````yaml post /session/start
openapi: 3.0.3
info:
  title: HoneyHive API
  version: 1.0.1
servers:
  - url: https://api.honeyhive.ai
security:
  - BearerAuth: []
paths:
  /session/start:
    post:
      tags:
        - Session
      summary: Start a new session
      operationId: startSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                session:
                  $ref: '#/components/schemas/SessionStartRequest'
      responses:
        '200':
          description: Session successfully started
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id:
                    type: string
      x-codeSamples:
        - lang: python
          label: startSession
          source: >-
            import honeyhive

            from honeyhive.models import components, operations


            s = honeyhive.HoneyHive(
                bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
            )



            res =
            s.session.start_session(request=operations.StartSessionRequestBody(
                session=components.SessionStartRequest(
                    project='Simple RAG Project',
                    session_name='Playground Session',
                    source='playground',
                    session_id='caf77ace-3417-4da4-944d-f4a0688f3c23',
                    children_ids=[
                        '7f22137a-6911-4ed3-bc36-110f1dde6b66',
                    ],
                    inputs={
                        'context': 'Hello world',
                        'question': 'What is in the context?',
                        'chat_history': [
                            {
                                'role': 'system',
                                'content': 'Answer the user\'s question only using provided context.

                                Context: Hello world',
                            },
                            {
                                'role': 'user',
                                'content': 'What is in the context?',
                            },
                        ],
                    },
                    outputs={
                        'role': 'assistant',
                        'content': 'Hello world',
                    },
                    error=None,
                    duration=824.8056,
                    user_properties={
                        'user': 'google-oauth2|111840237613341303366',
                    },
                    metrics={

                    },
                    feedback={

                    },
                    metadata={

                    },
                    start_time=1712025501605,
                    end_time=1712025499832,
                ),
            ))


            if res.object is not None:
                # handle response
                pass
        - lang: typescript
          label: startSession
          source: |-
            import { HoneyHive } from "honeyhive";

            async function run() {
              const sdk = new HoneyHive({
                bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
              });

              const res = await sdk.session.startSession({
                session: {
                  project: "Simple RAG Project",
                  sessionName: "Playground Session",
                  source: "playground",
                  sessionId: "caf77ace-3417-4da4-944d-f4a0688f3c23",
                  childrenIds: [
                    "7f22137a-6911-4ed3-bc36-110f1dde6b66",
                  ],
                  config: {
                    "key": "<value>",
                  },
                  inputs: {
                    "context": "Hello world",
                    "question": "What is in the context?",
                    "chat_history": [
                      {
                        "role": "system",
                        "content": "Answer the user's question only using provided context.

                        Context: Hello world",
                      },
                      {
                        "role": "user",
                        "content": "What is in the context?",
                      },
                    ],
                  },
                  outputs: {
                    "role": "assistant",
                    "content": "Hello world",
                  },
                  error: null,
                  duration: 824.8056,
                  userProperties: {
                    "user": "google-oauth2|111840237613341303366",
                  },
                  metrics: {

                  },
                  feedback: {

                  },
                  metadata: {

                  },
                  startTime: 1712025501605,
                  endTime: 1712025499832,
                },
              });

              if (res.statusCode == 200) {
                // handle response
              }
            }

            run();
components:
  schemas:
    SessionStartRequest:
      type: object
      properties:
        project:
          type: string
          description: Project name associated with the session
        session_name:
          type: string
          description: Name of the session
        source:
          type: string
          description: Source of the session - production, staging, etc
        session_id:
          type: string
          description: Unique id of the session, if not set, it will be auto-generated
        children_ids:
          type: array
          items:
            type: string
          description: Id of events that are nested within the session
        config:
          type: object
          additionalProperties: true
          description: Associated configuration for the session
        inputs:
          type: object
          additionalProperties: true
          description: Input object passed to the session - user query, text blob, etc
        outputs:
          type: object
          additionalProperties: true
          description: Final output of the session - completion, chunks, etc
        error:
          type: string
          description: Any error description if session failed
        duration:
          type: number
          description: How long the session took in milliseconds
        user_properties:
          type: object
          additionalProperties: true
          description: Any user properties associated with the session
        metrics:
          type: object
          additionalProperties: true
          description: Any values computed over the output of the session
        feedback:
          type: object
          additionalProperties: true
          description: Any user feedback provided for the session output
        metadata:
          type: object
          additionalProperties: true
          description: Any system or application metadata associated with the session
        start_time:
          type: number
          description: UTC timestamp (in milliseconds) for the session start
        end_time:
          type: integer
          description: UTC timestamp (in milliseconds) for the session end
      required:
        - project
        - session_name
        - source
      example:
        project: Simple RAG Project
        source: playground
        event_type: session
        session_name: Playground Session
        session_id: caf77ace-3417-4da4-944d-f4a0688f3c23
        event_id: caf77ace-3417-4da4-944d-f4a0688f3c23
        parent_id: null
        children_ids:
          - 7f22137a-6911-4ed3-bc36-110f1dde6b66
        inputs:
          context: Hello world
          question: What is in the context?
          chat_history:
            - role: system
              content: |-
                Answer the user's question only using provided context.

                Context: Hello world
            - role: user
              content: What is in the context?
        outputs:
          role: assistant
          content: Hello world
        error: null
        start_time: 1712025501605
        end_time: 1712025499832
        duration: 824.8056
        metrics: {}
        feedback: {}
        metadata: {}
        user_properties:
          user: google-oauth2|111840237613341303366
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````