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

# Create an AI provider

> Add an AI provider this organization's own key pays for. provider is one of anthropic, openai, openrouter, ollama, bedrock, gemini, portkey, langchain. model_overrides pins a model per purpose, keyed by purpose: investigation, suggestion, report_generation, alert_grouping, context_compaction, pr_review, remediation, oversight, config_watch, finops, slack_assistant, board_assistant, runbook_suggestion, sli_suggestion, capacity_planning, status_page_draft, ticket_synthesis, security_triage. Needs the plan's bring-your-own-provider feature.



## OpenAPI

````yaml /api-reference/openapi.json post /ai_providers
openapi: 3.1.0
info:
  description: >-
    A resource-shaped endpoint onto the same tool surface the MCP server
    (/api/mcp) reaches. Every gate, refusal and audit row a caller sees here is
    the exact one the MCP endpoint answers for the same tool. Authenticated with
    an API key holding the api:admin scope, or the read-only api:config_read
    scope for GET alone.
  title: SRE Agent configuration API
  version: 1.0.0
servers:
  - url: https://sreagent.app/api/v1/config
security:
  - apiKey: []
tags:
  - name: ai_providers
  - name: ai_settings
  - name: alert_mutes
  - name: alert_routes
  - name: aws_external_id
  - name: certificate_monitors
  - name: change_notifications
  - name: compliance_periods
  - name: connectors
  - name: data_sources
  - name: deploy_policies
  - name: export
  - name: github_settings
  - name: image_targets
  - name: notification_settings
  - name: organization_settings
  - name: outbound_configs
  - name: outbound_rules
  - name: overseer_settings
  - name: prompt_templates
  - name: repo_settings
  - name: service_bindings
  - name: slack
  - name: slis
  - name: slos
  - name: status_page_components
  - name: status_page_incidents
  - name: status_page_settings
  - name: synthetic_checks
  - name: team_members
  - name: teams
  - name: ticket_import_rules
  - name: ticket_integrations
paths:
  /ai_providers:
    post:
      tags:
        - ai_providers
      summary: Create an AI provider
      description: >-
        Add an AI provider this organization's own key pays for. provider is one
        of anthropic, openai, openrouter, ollama, bedrock, gemini, portkey,
        langchain. model_overrides pins a model per purpose, keyed by purpose:
        investigation, suggestion, report_generation, alert_grouping,
        context_compaction, pr_review, remediation, oversight, config_watch,
        finops, slack_assistant, board_assistant, runbook_suggestion,
        sli_suggestion, capacity_planning, status_page_draft, ticket_synthesis,
        security_triage. Needs the plan's bring-your-own-provider feature.
      operationId: create_ai_provider
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              properties:
                api_key:
                  description: >-
                    The provider's key. Write-only: it is never answered by any
                    tool here, an omitted one keeps the stored key, and an empty
                    one is refused rather than read as a way to remove it. To
                    remove it, delete the provider. Paste the key itself; a URL
                    goes in base_url and is refused here.
                  format: password
                  type: string
                  writeOnly: true
                auto_upgrade_model:
                  description: >-
                    Whether the platform may move `model` on to a successor once
                    the configured one drops out of the provider's list. Off by
                    default: a pinned model stays pinned.
                  type: boolean
                base_url:
                  description: >-
                    Where to send the calls, for a gateway or a self-hosted
                    endpoint. null uses the provider's own.
                  type:
                    - string
                    - 'null'
                enabled:
                  description: >-
                    Whether the router may route to this provider at all. A
                    disabled row keeps its key and its pins and is skipped.
                  type: boolean
                max_tokens:
                  description: >-
                    The ceiling on one answer's length. null uses the platform's
                    own.
                  type:
                    - integer
                    - 'null'
                model:
                  description: >-
                    The model to use, spelled as the provider spells it. null
                    leaves the choice to the platform's own default.
                  type:
                    - string
                    - 'null'
                model_overrides:
                  description: >-
                    A model per purpose, keyed by purpose: investigation,
                    suggestion, report_generation, alert_grouping,
                    context_compaction, pr_review, remediation, oversight,
                    config_watch, finops, slack_assistant, board_assistant,
                    runbook_suggestion, sli_suggestion, capacity_planning,
                    status_page_draft, ticket_synthesis, security_triage. Merged
                    into what is stored, so a map naming one purpose leaves the
                    rest alone; an empty string under a purpose clears that pin.
                    The value "auto" hands the choice to the platform's own
                    model selection for that purpose.
                  type: object
                name:
                  description: >-
                    What this provider is called here, unique within the
                    organization. It is a label for the people reading the list,
                    not anything the provider sees.
                  type: string
                priority:
                  description: >-
                    The order the router tries this organization's providers in,
                    lowest first. At least 1.
                  type: integer
                provider:
                  description: >-
                    Which provider this row talks to: anthropic, openai,
                    openrouter, ollama, bedrock, gemini, portkey, langchain.
                  enum:
                    - anthropic
                    - openai
                    - openrouter
                    - ollama
                    - bedrock
                    - gemini
                    - portkey
                    - langchain
                  type: string
                rate_limit_rpm:
                  description: >-
                    Requests per minute this provider will accept. null means no
                    limit.
                  type:
                    - integer
                    - 'null'
                temperature:
                  description: 0 to 2. null leaves the provider's own default in place.
                  type:
                    - number
                    - 'null'
                timeout_ms:
                  description: >-
                    How long one request may take, at most 600000. null uses the
                    platform's own.
                  type:
                    - integer
                    - 'null'
              required:
                - name
                - provider
              type: object
        required: true
      responses:
        '201':
          description: Created.
        '409':
          description: A row already matches this resource's natural key.
        '422':
          description: The tool refused the request's shape or content.
        default:
          description: The request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      description: The body of every failed request.
      properties:
        error:
          type: string
          description: >-
            A short machine-readable code such as forbidden, conflict or
            read_only_key.
        message:
          type: string
          description: A sentence that says what to change.
      required:
        - error
        - message
      additionalProperties: true
  securitySchemes:
    apiKey:
      description: >-
        An sre_ak_* API key holding the api:admin scope (or api:config_read,
        which every write refuses with read_only_key).
      scheme: bearer
      type: http

````

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