> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Provider Connection



## OpenAPI

````yaml /openapi/agent-sdk.json post /api/llm/provider-connections
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/llm/provider-connections:
    post:
      tags:
        - LLM Provider Connections
      summary: Create Provider Connection
      operationId: create_provider_connection_api_llm_provider_connections_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProviderConnectionCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderConnectionResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    ProviderConnectionCreateRequest:
      additionalProperties: false
      properties:
        api_key:
          format: password
          minLength: 1
          title: Api Key
          type: string
          writeOnly: true
        base_url:
          anyOf:
            - maxLength: 2048
              type: string
            - type: 'null'
          title: Base Url
        display_name:
          maxLength: 128
          minLength: 1
          title: Display Name
          type: string
        provider:
          default: custom
          maxLength: 128
          minLength: 1
          title: Provider
          type: string
      required:
        - display_name
        - api_key
      title: ProviderConnectionCreateRequest
      type: object
    ProviderConnectionResponse:
      properties:
        api_key_set:
          default: false
          title: Api Key Set
          type: boolean
        base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Url
        created_at:
          title: Created At
          type: integer
        display_name:
          title: Display Name
          type: string
        id:
          title: Id
          type: string
        provider:
          title: Provider
          type: string
        updated_at:
          title: Updated At
          type: integer
      required:
        - id
        - display_name
        - provider
        - created_at
        - updated_at
      title: ProviderConnectionResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

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