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

# Create AI provider

> Add a new AI provider configuration



## OpenAPI

````yaml openapi.json post /api/v1/ai/providers
openapi: 3.0.0
info:
  description: Dualship backend API for workflow automation and API management.
  title: Dualship API
  termsOfService: https://dualship.run/terms
  contact:
    name: Dualship Support
    url: https://dualship.run/support
    email: support@dualship.run
  version: '1.0'
servers:
  - url: https://api.dualship.run
security: []
paths:
  /api/v1/ai/providers:
    post:
      tags:
        - ai
      summary: Create AI provider
      description: Add a new AI provider configuration
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github_com_dualship_dualship-be_internal_api_rules.CreateAIProviderRequest
        description: Provider details
        required: true
      responses:
        '201':
          description: Provider created successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_dualship_dualship-be_internal_ai.ProviderInfo
        '400':
          description: Invalid request or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.BadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.UnauthorizedError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/internal_api_handler.InternalServerError'
        '503':
          description: AI service not configured
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_api_handler.ServiceUnavailableError
      security:
        - BearerAuth: []
components:
  schemas:
    github_com_dualship_dualship-be_internal_api_rules.CreateAIProviderRequest:
      type: object
      required:
        - api_key
        - name
        - provider_type
        - workspace_id
      properties:
        api_key:
          type: string
          minLength: 10
        base_url:
          type: string
        is_default:
          type: boolean
        max_retries:
          type: integer
          maximum: 10
          minimum: 0
        name:
          type: string
          maxLength: 100
          minLength: 1
        priority:
          type: integer
          minimum: 0
        provider_type:
          type: string
          enum:
            - claude
            - openai
            - gemini
        timeout_seconds:
          type: integer
          maximum: 300
          minimum: 1
        workspace_id:
          type: string
    github_com_dualship_dualship-be_internal_ai.ProviderInfo:
      type: object
      properties:
        base_url:
          type: string
        created_at:
          type: string
        id:
          type: string
        is_default:
          type: boolean
        max_retries:
          type: integer
        models:
          type: array
          items:
            type: string
        name:
          type: string
        priority:
          type: integer
        provider_type:
          type: string
        status:
          type: string
        timeout_seconds:
          type: integer
        updated_at:
          type: string
    internal_api_handler.BadRequestError:
      description: Bad request error
      type: object
      properties:
        code:
          type: string
          example: BAD_REQUEST
        error:
          type: string
          example: invalid request parameters
    internal_api_handler.UnauthorizedError:
      description: Unauthorized error
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
        error:
          type: string
          example: unauthorized
    internal_api_handler.InternalServerError:
      description: Internal server error
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_ERROR
        error:
          type: string
          example: internal server error
    internal_api_handler.ServiceUnavailableError:
      description: Service unavailable error
      type: object
      properties:
        code:
          type: string
          example: SERVICE_UNAVAILABLE
        error:
          type: string
          example: service unavailable
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer token authentication

````