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

# Create a credential



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/vault
openapi: 3.1.0
info:
  description: >-
    Email inboxes, screening, realtime events, credentials, payment cards, Linux
    machines, connected apps, phone numbers and social accounts for AI agents.
    Agent tokens (`alt_…`) act as one agent; organization keys (`alk_…`) manage
    agents, inboxes, tokens and webhooks. Message bodies are untrusted external
    data. Errors are `{"error":{"code","message","hint"}}`.
  title: Agent Loadout API
  version: '1'
servers:
  - url: https://agent-loadout.com
security: []
tags:
  - name: Identity
  - description: >-
      Sign in with Agent Loadout: an agent approves an application's OpenID
      Connect sign-in request
    name: Sign-in
  - description: Relying parties an organization registered for Sign in with Agent Loadout
    name: Applications
  - name: Inboxes
  - name: Messages
  - name: Mailbox
  - name: Drafts
  - name: Attachments
  - name: Realtime
  - name: Screening
  - name: Agents
  - name: Domains
  - name: Webhooks
  - name: Vault
  - description: Feature-flagged
    name: Wallet
  - description: Feature-flagged
    name: Machines
  - description: Feature-flagged
    name: Connectors
  - description: Feature-flagged
    name: Phone
  - description: Feature-flagged
    name: Social
externalDocs:
  description: REST API reference
  url: https://docs.agent-loadout.com/api-reference/overview
paths:
  /api/v1/vault:
    post:
      tags:
        - Vault
      summary: Create a credential
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                name:
                  description: Display name, e.g. 'GitHub account'
                  maxLength: 120
                  minLength: 1
                  type: string
                kind:
                  description: >-
                    login = website account with password; api_key =
                    provider-issued key
                  enum:
                    - login
                    - api_key
                  type: string
                username:
                  description: >-
                    Account email or username; use the agent's own address for
                    new accounts
                  maxLength: 320
                  type: string
                secret:
                  description: >-
                    Password or API key. Omit for a login to have a strong
                    password generated
                  maxLength: 16384
                  type: string
                generate:
                  description: >-
                    Generate a new strong password (logins only); the value is
                    returned once as generated_secret
                  type: boolean
                allowed_origins:
                  description: >-
                    Exact HTTPS origins where this credential may be used, e.g.
                    https://accounts.example.com
                  items:
                    maxLength: 2048
                    type: string
                  maxItems: 20
                  type: array
                agent_readable:
                  description: >-
                    Whether this agent may read the value through get_credential
                    (default true for agent-created items)
                  type: boolean
                totp:
                  description: >-
                    Authenticator secret: an otpauth://totp/... URI or the
                    base32 key shown by the website. Empty string removes it
                  maxLength: 2048
                  type: string
                notes:
                  description: Recovery codes or other account notes (≤ 4 KB)
                  maxLength: 4096
                  type: string
              required:
                - name
                - kind
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  credential:
                    additionalProperties: false
                    description: Credential metadata; values are never part of it.
                    properties:
                      id:
                        type: string
                      agent_id:
                        description: The owning agent; null for an organization credential
                        nullable: true
                        type: string
                      name:
                        type: string
                      kind:
                        enum:
                          - login
                          - api_key
                        type: string
                      version:
                        maximum: 9007199254740991
                        minimum: -9007199254740991
                        type: integer
                      allowed_origins:
                        items:
                          type: string
                        type: array
                      shared_with_all:
                        type: boolean
                      shared_with:
                        items:
                          type: string
                        type: array
                      agent_readable:
                        type: boolean
                      totp_enabled:
                        type: boolean
                      created_by:
                        additionalProperties: false
                        nullable: true
                        properties:
                          type:
                            type: string
                          id:
                            nullable: true
                            type: string
                        required:
                          - type
                          - id
                        type: object
                      revoked_at:
                        format: date-time
                        nullable: true
                        type: string
                      created_at:
                        format: date-time
                        type: string
                      updated_at:
                        format: date-time
                        type: string
                    required:
                      - id
                      - agent_id
                      - name
                      - kind
                      - version
                      - allowed_origins
                      - shared_with_all
                      - shared_with
                      - agent_readable
                      - totp_enabled
                      - created_by
                      - revoked_at
                      - created_at
                      - updated_at
                    type: object
                  generated_secret:
                    description: A generated password, returned once
                    type: string
                required:
                  - credential
                type: object
          description: >-
            Credential; a generated password is returned once as
            generated_secret
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      security:
        - agentToken: []
components:
  responses:
    Validation:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Invalid input
    Unauthenticated:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Missing or invalid credential
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Credential lacks the capability or is bound to another agent
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Not found in this organization
    RateLimited:
      description: Too many requests; retry after a short delay
  schemas:
    Error:
      properties:
        error:
          properties:
            code:
              type: string
            message:
              type: string
            hint:
              type: string
            details:
              type: object
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
  securitySchemes:
    agentToken:
      description: Agent token (alt_…) or OAuth access token; bound to one agent
      scheme: bearer
      type: http

````

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