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

# Create a Session

> Creates a long-lived session bound to an agent. Provisions no sandbox and charges nothing — cost starts at the first event.



## OpenAPI

````yaml POST /v1/sessions
openapi: 3.0.0
info:
  title: Profy Platform API
  version: 1.0.0
  description: >-
    Platform API for building on Profy — invoke Experts, use models, report
    billing events, and manage OAuth.
servers:
  - url: https://api.profy.cn
    description: Production
security: []
paths:
  /v1/sessions:
    post:
      tags:
        - Platform API
      summary: Create a session
      description: >-
        Creates a long-lived session bound to an agent. Provisions no sandbox
        and charges nothing — cost starts at the first event.
      operationId: createSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent
              properties:
                agent:
                  type: string
                  description: Agent (expert) identifier
                title:
                  type: string
                environment_id:
                  type: string
                  description: Environment resolved lazily at each run
      responses:
        '200':
          description: Created
        '401':
          description: Unauthorized
        '404':
          description: Environment not found
      security:
        - BearerToken: []
        - ApiKey: []
components:
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token issued via POST /oauth/token
    ApiKey:
      type: http
      scheme: bearer
      description: Developer API Key (sk-pro-xxx) created at platform.profy.cn

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.