Casama AI Credentials API

The credentials API from Casama AI, for credentials.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 8

POST /v1/credentials Store a model key in Vault; returns metadata only #
GET /v1/credentials List credentials #
POST /v1/credentials/{id}/test Validate a key with a 1-token call #
PATCH /v1/credentials/{id} Rename a credential or change its settings #
DELETE /v1/credentials/{id} Delete a credential and its Vault secret (a ChatGPT sign-in is revoked first) #
GET /v1/credentials/{id}/models Models this key can use, recommended ones first #
POST /v1/credentials/chatgpt/start Begin ChatGPT sign-in; returns the authorize URL for a loopback callback #
POST /v1/credentials/chatgpt/complete Finish ChatGPT sign-in; the server exchanges the code and keeps the tokens in… #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/casama-ai:casama-ai-credentials-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

casama-ai-credentials-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Casama Credentials API
  version: 0.1.0
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://api.casama.ai
tags:
- name: Credentials
paths:
  /v1/credentials:
    post:
      operationId: createCredential
      tags:
      - Credentials
      security:
      - bearerAuth: []
      summary: Store a model key in Vault; returns metadata only
      parameters:
      - schema:
          type: string
          maxLength: 255
          description: Retries with the same key return the first result
        required: false
        description: Retries with the same key return the first result
        name: idempotency-key
        in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCredentialRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
        '400':
          description: Validation failed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
    get:
      operationId: listCredentials
      tags:
      - Credentials
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: org_id
        in: query
      responses:
        '200':
          description: Credential metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialList'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      summary: List credentials
      x-summary-source: derived
  /v1/credentials/{id}/test:
    post:
      operationId: testCredential
      tags:
      - Credentials
      security:
      - bearerAuth: []
      summary: Validate a key with a 1-token call
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestCredentialRequest'
      responses:
        '200':
          description: Result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialTestResult'
        '400':
          description: Validation failed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /v1/credentials/{id}:
    patch:
      operationId: updateCredential
      tags:
      - Credentials
      security:
      - bearerAuth: []
      summary: Rename a credential or change its settings
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCredentialRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
        '400':
          description: Validation failed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
    delete:
      operationId: deleteCredential
      tags:
      - Credentials
      security:
      - bearerAuth: []
      summary: Delete a credential and its Vault secret (a ChatGPT sign-in is revoked first)
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      responses:
        '204':
          description: Deleted
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /v1/credentials/{id}/models:
    get:
      operationId: listCredentialModels
      tags:
      - Credentials
      security:
      - bearerAuth: []
      summary: Models this key can use, recommended ones first
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: id
        in: path
      responses:
        '200':
          description: Models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelOptionList'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /v1/credentials/chatgpt/start:
    post:
      operationId: startChatGptSignIn
      tags:
      - Credentials
      security:
      - bearerAuth: []
      summary: Begin ChatGPT sign-in; returns the authorize URL for a loopback callback
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatGptSignInStartRequest'
      responses:
        '200':
          description: Sign-in started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatGptSignInStart'
        '400':
          description: Validation failed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
  /v1/credentials/chatgpt/complete:
    post:
      operationId: completeChatGptSignIn
      tags:
      - Credentials
      security:
      - bearerAuth: []
      summary: Finish ChatGPT sign-in; the server exchanges the code and keeps the tokens in…
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatGptSignInCompleteRequest'
      responses:
        '200':
          description: Connected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Credential'
        '400':
          description: Validation failed
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
components:
  schemas:
    CredentialList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Credential'
      required:
      - items
    ProviderId:
      type: string
      enum:
      - openai
      - anthropic
      - google
      - xai
      - openrouter
      - openai_compatible
      - brave_search
      - tavily
      - chatgpt
      - treg
      - google_maps
      - mapbox
      - parallel
      - serper
    CredentialStatus:
      type: string
      enum:
      - ok
      - plan_usage_off
      - needs_reconnect
      description: 'ok; plan_usage_off: signed in to ChatGPT without granting plan usage; needs_reconnect: sign in again'
    CreateCredentialRequest:
      type: object
      properties:
        org_id:
          type: string
          format: uuid
        provider:
          $ref: '#/components/schemas/ProviderId'
        label:
          type: string
          minLength: 1
          maxLength: 80
        api_key:
          type: string
          minLength: 1
          maxLength: 4000
          description: Stored in Vault; never returned
        base_url:
          type: string
          format: uri
        embedding_model:
          type: string
          minLength: 1
          maxLength: 200
          description: 'openai_compatible only: an embedding model on that server, for memory search'
        vision_models:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 200
          maxItems: 50
          description: 'openai_compatible only: models on that server that read images, if Casama doesn''t recognize them'
      required:
      - org_id
      - provider
      - label
    ModelOption:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        context_length:
          type: integer
        featured:
          type: boolean
          description: Recommended by Casama; listed first
        tools:
          type: boolean
          description: Whether the model supports tool calls (when known from the model catalog)
      required:
      - id
      - name
    ChatGptSignInStart:
      type: object
      properties:
        authorize_url:
          type: string
        redirect_uri:
          type: string
        state:
          type: string
        expires_at:
          type: string
          format: date-time
      required:
      - authorize_url
      - redirect_uri
      - state
      - expires_at
    UpdateCredentialRequest:
      type: object
      properties:
        label:
          type: string
          minLength: 1
          maxLength: 80
        fallback_on_limit:
          type: boolean
        embedding_model:
          type:
          - string
          - 'null'
          maxLength: 200
          description: openai_compatible only; null or empty turns it off
        vision_models:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 200
          maxItems: 50
          description: openai_compatible only; replaces the list, [] clears it
    ModelOptionList:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ModelOption'
        source:
          type: string
          enum:
          - live
          - featured
          description: 'live: the provider''s own list; featured: Casama''s short list (provider unreachable or fixture mode)'
        error:
          type: string
      required:
      - items
      - source
    Problem:
      type: object
      properties:
        type:
          type: string
          example: https://casama.ai/problems/not_found
        title:
          type: string
        status:
          type: integer
        code:
          type: string
          description: Stable error code
          example: not_found
        detail:
          type: string
        instance:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
            - path
            - message
          description: Field errors for validation_failed
      required:
      - type
      - title
      - status
      - code
    TestCredentialRequest:
      type: object
      properties:
        model:
          type: string
          minLength: 1
          maxLength: 200
    ChatGptSignInStartRequest:
      type: object
      properties:
        org_id:
          type: string
          format: uuid
        redirect_port:
          type: integer
          minimum: 1024
          maximum: 65535
          description: The client's loopback port; OpenAI redirects to http://127.0.0.1:<port>/auth/callback
        credential_id:
          type: string
          format: uuid
          description: Reconnect this ChatGPT credential
      required:
      - org_id
      - redirect_port
    CredentialTestResult:
      type: object
      properties:
        ok:
          type: boolean
        model:
          type: string
        latency_ms:
          type: integer
        error:
          type: string
      required:
      - ok
      - model
      - latency_ms
    ChatGptSignInCompleteRequest:
      type: object
      properties:
        state:
          type: string
          minLength: 16
          maxLength: 200
        code:
          type: string
          minLength: 1
          maxLength: 4000
        client_id:
          type: string
          minLength: 1
          maxLength: 200
          description: The issued client id from the callback (first sign-in)
        error:
          type: string
          maxLength: 200
        error_description:
          type: string
          maxLength: 1000
      required:
      - state
    Credential:
      type: object
      properties:
        id:
          type: string
          format: uuid
        org_id:
          type: string
          format: uuid
        provider:
          $ref: '#/components/schemas/ProviderId'
        label:
          type: string
        base_url:
          type:
          - string
          - 'null'
        key_hint:
          type:
          - string
          - 'null'
          description: Last 4 characters of the key
        last_tested_at:
          type:
          - string
          - 'null'
          format: date-time
        last_test_ok:
          type:
          - boolean
          - 'null'
        owner_user_id:
          type:
          - string
          - 'null'
          format: uuid
          description: 'Set for personal credentials (a ChatGPT plan): only the owner''s runs use it'
        status:
          $ref: '#/components/schemas/CredentialStatus'
        account:
          type:
          - string
          - 'null'
          description: The signed-in ChatGPT account's email (chatgpt only)
        fallback_on_limit:
          type: boolean
          description: If this provider fails or hits its limit, use the bot's next model (or Casama's models on Cloud)
        embedding_model:
          type:
          - string
          - 'null'
          description: 'openai_compatible: the server''s embedding model, used for memory and knowledge search when there''s no OpenAI key (D-271)'
        vision_models:
          type: array
          items:
            type: string
          description: 'openai_compatible: models on this server marked as reading images, beyond the ones Casama recognizes (D-330). Missing from servers before D-330'
        created_at:
          type: string
          format: date-time
      required:
      - id
      - org_id
      - provider
      - label
      - base_url
      - key_hint
      - last_tested_at
      - last_test_ok
      - owner_user_id
      - status
      - account
      - fallback_on_limit
      - embedding_model
      - created_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Supabase access token