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

# Connect a generation provider key



## OpenAPI

````yaml /openapi/buyer.yaml post /api/v2/buyer/creative/model-credentials
openapi: 3.1.0
info:
  title: Semicola Exchange buyer API
  version: 2.0.0
  description: >-
    Buyer endpoints: advertisers, storefronts and connections, product
    discovery, campaigns, proposals, media buys, creatives and reporting. Every
    write accepts an Idempotency-Key header.
servers:
  - url: https://api.semicola.com
security:
  - bearerAuth: []
  - sessionCookie: []
tags:
  - name: Advertisers
  - name: Storefronts
  - name: Product Discovery
  - name: Campaigns
  - name: Media Buys
  - name: Update Proposals
  - name: Optimization Suggestions
  - name: Creatives
  - name: Catalogs
  - name: Property Lists
  - name: Audiences
  - name: Syndication
  - name: Reporting
  - name: Event Sources
  - name: Webhooks
  - name: Tasks
  - name: Audit Logs
  - name: Activity
paths:
  /api/v2/buyer/creative/model-credentials:
    post:
      tags:
        - Creatives
      summary: Connect a generation provider key
      operationId: postBuyerCreativeModelCredentials
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                providerType:
                  type: string
                  enum:
                    - openai
                    - gemini
                    - fal
                apiKey:
                  type: string
                  minLength: 8
                  maxLength: 4096
                label:
                  type: string
                  minLength: 1
                  maxLength: 120
                advertiserIds:
                  maxItems: 500
                  type: array
                  items:
                    anyOf:
                      - type: integer
                        exclusiveMinimum: 0
                        maximum: 9007199254740991
                      - type: string
                        pattern: ^[1-9]\d*$
                isDefault:
                  type: boolean
              required:
                - providerType
                - apiKey
                - label
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    anyOf:
                      - type: object
                        properties:
                          id:
                            type: string
                          customerId:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          advertiserIds:
                            type: array
                            items:
                              type: string
                          isDefault:
                            type: boolean
                          providerType:
                            type: string
                            enum:
                              - openai
                              - gemini
                              - fal
                          providerDisplayName:
                            type: string
                          label:
                            type: string
                          status:
                            type: string
                            enum:
                              - ACTIVE
                              - REVOKED
                              - ERROR
                          maskedKey:
                            type:
                              - string
                              - 'null'
                          connectedBy:
                            type:
                              - string
                              - 'null'
                          createdAt:
                            type: string
                          updatedAt:
                            type: string
                        required:
                          - id
                          - customerId
                          - advertiserIds
                          - isDefault
                          - providerType
                          - providerDisplayName
                          - label
                          - status
                          - maskedKey
                          - connectedBy
                          - createdAt
                          - updatedAt
                        additionalProperties: false
                      - type: 'null'
                  error:
                    anyOf:
                      - type: object
                        properties:
                          code:
                            type: string
                          message:
                            type: string
                          field:
                            type: string
                          details: {}
                        required:
                          - code
                          - message
                        additionalProperties: false
                      - type: 'null'
                required:
                  - data
                  - error
                additionalProperties: false
        default:
          description: >-
            Error envelope `{data: null, error: {code, message, field?,
            details?}}`.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or OAuth access token.
    sessionCookie:
      type: apiKey
      in: cookie
      name: sc_session

````