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

# List code providers

> Returns a collection of code providers.

Required API key scopes: any of `code-providers:read`, `code-providers:all`, `all:read`, `all:all`.



## OpenAPI

````yaml /coding-agent-api/openapi.json get /api/v1/code-providers
openapi: 3.1.0
info:
  title: Agen Coding Agent API
  version: 1.0.0
servers:
  - url: https://api.agenhq.com
security: []
paths:
  /api/v1/code-providers:
    get:
      tags:
        - Code Providers
      summary: List code providers
      description: >-
        Returns a collection of code providers.


        Required API key scopes: any of `code-providers:read`,
        `code-providers:all`, `all:read`, `all:all`.
      operationId: listCode-providers
      responses:
        '200':
          description: >-
            A paginated list of code provider connections configured for a
            workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodeProvidersList'
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - statusCode
                  - code
                  - error
                  - message
                properties:
                  statusCode:
                    type: number
                  code:
                    type: string
                  error:
                    type: string
                  message:
                    type: string
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
      security:
        - apiKey: []
components:
  schemas:
    CodeProvidersList:
      type: object
      required:
        - items
        - next_cursor
      properties:
        items:
          type: array
          items:
            type: object
            required:
              - id
              - workspace_id
              - user_id
              - platform
              - name
              - base_url
              - metadata
              - created_at
              - updated_at
            properties:
              id:
                readOnly: true
                description: >-
                  The unique identifier of the code provider connection inside
                  Agen.
                type: string
              workspace_id:
                readOnly: true
                description: The workspace that owns this code provider connection.
                type: string
              user_id:
                readOnly: true
                description: The user who connected this code provider account.
                type: string
              platform:
                anyOf:
                  - const: gitlab
                    type: string
                  - const: github
                    type: string
              name:
                description: A human-readable name for the connected code provider account.
                type: string
              base_url:
                description: >-
                  The base URL Agen should use to talk to the code hosting
                  platform API.
                type: string
              metadata:
                anyOf:
                  - type: object
                    required:
                      - type
                      - token
                    properties:
                      type:
                        const: gitlab_personal_access_token
                        type: string
                      token:
                        description: >-
                          The GitLab personal access token Agen should store
                          securely for this connection. Returned values are
                          masked in API responses.
                        type: string
                  - type: object
                    required:
                      - type
                      - token
                    properties:
                      type:
                        const: github_personal_access_token
                        type: string
                      token:
                        description: >-
                          The GitHub personal access token Agen should store
                          securely for this connection. Returned values are
                          masked in API responses.
                        type: string
                  - type: object
                    required:
                      - type
                      - access_token
                    properties:
                      type:
                        const: github_oauth
                        type: string
                      access_token:
                        description: >-
                          The GitHub OAuth access token Agen stores securely for
                          this connection. Returned values are masked in API
                          responses.
                        type: string
                      login:
                        type: string
                      github_user_id:
                        type: number
              created_at:
                format: date-time
                readOnly: true
                description: When the code provider connection was created in Agen.
                type: string
              updated_at:
                format: date-time
                readOnly: true
                description: When the code provider connection was last updated in Agen.
                type: string
            description: A code provider connection configured for a workspace.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
      description: >-
        A paginated list of code provider connections configured for a
        workspace.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````