> ## Documentation index
> Fetch the complete documentation index at: https://docs.rxresu.me/llms.txt
> Ask it with GET https://docs.rxresu.me/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# Create saved AI provider

> Stores an encrypted provider/model/API key combination. The key is never returned.

`POST /ai-providers`

## OpenAPI

````yaml spec.json post /ai-providers
openapi: 3.1.1
info:
  title: Reactive Resume
  version: 6.0.7
  description: "Reactive Resume API. Mutations do not support Idempotency-Key. Do
    not automatically retry POST, PUT, PATCH or DELETE requests after a timeout:
    first read the resource to determine whether the operation succeeded.
    Existing enum values and response shapes are retained for compatibility."
  license:
    name: MIT
    url: https://github.com/reactive-resume/reactive-resume/blob/main/LICENSE
  contact:
    name: Amruth Pillai
    email: amruth@rxresu.me
    url: https://amruthpillai.com
servers:
  - url: https://rxresu.me/api/openapi
security:
  - apiKey: []
  - bearerAuth: []
  - cookieAuth: []
paths:
  /ai-providers:
    post:
      operationId: createAiProvider
      summary: Create saved AI provider
      description: Stores an encrypted provider/model/API key combination. The key is
        never returned.
      tags:
        - AI Providers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  minLength: 1
                provider:
                  enum:
                    - openai
                    - anthropic
                    - gemini
                    - vercel-ai-gateway
                    - openrouter
                    - mistral
                    - cohere
                    - xai
                    - groq
                    - deepseek
                    - togetherai
                    - fireworks
                    - cerebras
                    - perplexity
                    - ollama
                    - openai-compatible
                  type: string
                model:
                  type: string
                  minLength: 1
                baseURL:
                  type: string
                apiKey:
                  type: string
              required:
                - label
                - provider
                - model
                - apiKey
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  managed:
                    type: boolean
                  id:
                    type: string
                  label:
                    type: string
                  provider:
                    enum:
                      - openai
                      - anthropic
                      - gemini
                      - vercel-ai-gateway
                      - openrouter
                      - mistral
                      - cohere
                      - xai
                      - groq
                      - deepseek
                      - togetherai
                      - fireworks
                      - cerebras
                      - perplexity
                      - ollama
                      - openai-compatible
                    type: string
                  model:
                    type: string
                  baseURL:
                    anyOf:
                      - type: string
                      - type: "null"
                  enabled:
                    type: boolean
                  isDefault:
                    type: boolean
                  testStatus:
                    type: string
                  testError:
                    anyOf:
                      - type: string
                      - type: "null"
                  apiKeyPreview:
                    type: string
                  apiKeyFingerprint:
                    type: string
                  lastTestedAt:
                    anyOf:
                      - type: string
                        format: date-time
                        x-native-type: date
                      - type: "null"
                  lastUsedAt:
                    anyOf:
                      - type: string
                        format: date-time
                        x-native-type: date
                      - type: "null"
                  createdAt:
                    type: string
                    format: date-time
                    x-native-type: date
                  updatedAt:
                    type: string
                    format: date-time
                    x-native-type: date
                required:
                  - managed
                  - id
                  - label
                  - provider
                  - model
                  - baseURL
                  - enabled
                  - isDefault
                  - testStatus
                  - testError
                  - apiKeyPreview
                  - apiKeyFingerprint
                  - lastTestedAt
                  - lastUsedAt
                  - createdAt
                  - updatedAt
        "400":
          description: "400"
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: BAD_REQUEST
                      status:
                        const: 400
                      message:
                        type: string
                        default: That provider setup isn't valid. Check the base URL and try again.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        "403":
          description: "403"
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: FORBIDDEN
                      status:
                        const: 403
                      message:
                        type: string
                        default: AI is set up by the server administrator and can't be changed here.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        "412":
          description: "412"
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: PRECONDITION_FAILED
                      status:
                        const: 412
                      message:
                        type: string
                        default: AI providers aren't available on this server. Ask the server
                          administrator to set ENCRYPTION_SECRET.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        default:
          description: Structured API error. See status and code; do not branch on message
            text.
          content:
            application/json:
              schema:
                type: object
                required:
                  - defined
                  - code
                  - status
                  - message
                properties:
                  defined:
                    type: boolean
                  code:
                    type: string
                  status:
                    type: integer
                  message:
                    type: string
                  data: {}
      security:
        - apiKey: []
        - bearerAuth: []
        - cookieAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >-
            curl --request POST "https://rxresu.me/api/openapi/ai-providers"
            --header "x-api-key: <api-key>" --header "Content-Type:
            application/json" --data '{
              "label": "<string>",
              "provider": "openai",
              "model": "<string>",
              "apiKey": "<string>"
            }'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: An OAuth access token issued by this instance for its API/MCP resource.
    cookieAuth:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Browser session (secure deployments use the __Secure- prefix).
        Cookie requests must originate from this instance.
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: The API key to authenticate requests.
````
