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

# Upload a skill

> Upload a skill as a set of files. Each file must be a supported type (md, txt, py, ts, js, json, yaml, yml, sh, toml, xml). Individual files are limited to 50KB and the total upload to 500KB. At most 20 files per upload.



## OpenAPI

````yaml /openapi.json post /skills/upload
openapi: 3.0.0
info:
  title: Lava API
  description: >-
    Lava API enables businesses to implement usage-based billing for AI
    services. This API allows tracking, managing, and billing for third-party AI
    API usage through a forwarding system.
  version: 1.0.0
  contact:
    name: Lava support
    url: https://www.lava.so/contact
servers:
  - url: https://api.lava.so/v1/
    description: Lava API v1
security: []
tags:
  - name: Authentication
  - name: Core Endpoints
  - name: Models
  - name: Services
  - name: Requests
  - name: Wallet
  - name: Payment Methods
  - name: Spend Keys
  - name: Usage
  - name: Checkout Sessions
  - name: Customers
  - name: Plans
  - name: Subscriptions
  - name: Meters
  - name: Webhooks
  - name: Secret Keys
  - name: Credit Bundles
  - name: Gateway Settings
  - name: Skills
  - name: News Data
  - name: Search
  - name: Enrich
paths:
  /skills/upload:
    post:
      tags:
        - Skills
      summary: Upload a skill
      description: >-
        Upload a skill as a set of files. Each file must be a supported type
        (md, txt, py, ts, js, json, yaml, yml, sh, toml, xml). Individual files
        are limited to 50KB and the total upload to 500KB. At most 20 files per
        upload.
      operationId: uploadSkill
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                skill_name:
                  type: string
                  pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
                  minLength: 1
                  maxLength: 100
                  example: my-skill
                  description: >-
                    Kebab-case skill name (lowercase letters, numbers, and
                    hyphens)
                files:
                  type: array
                  minItems: 1
                  maxItems: 20
                  description: Files to include in the skill
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        example: SKILL.md
                        description: Relative file path (no leading /, no .. segments)
                      type:
                        type: string
                        enum:
                          - md
                          - txt
                          - py
                          - ts
                          - js
                          - json
                          - yaml
                          - yml
                          - sh
                          - toml
                          - xml
                        description: File extension type
                      content:
                        type: string
                        description: File content (max 50KB per file)
                    required:
                      - path
                      - type
                      - content
              required:
                - skill_name
                - files
      responses:
        '201':
          description: Skill uploaded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  skill_name:
                    type: string
                    example: my-skill
                  file_count:
                    type: integer
                    example: 3
                  message:
                    type: string
                    example: Skill "my-skill" uploaded successfully (3 files).
                required:
                  - success
                  - skill_name
                  - file_count
                  - message
        '400':
          description: Validation error (invalid name, file type, or size)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Auth: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message describing what went wrong
              example: Invalid authentication credentials
            code:
              type: string
              description: Machine-readable error code describing what went wrong
              example: forward_token_json_invalid
            status:
              type: integer
              description: HTTP status code of the error
              example: 400
            issues:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                    description: Path to the field that caused the validation error
                  message:
                    type: string
                    description: Error message describing the validation issue
                required:
                  - path
                  - message
              description: >-
                Optional array of specific validation issues with their paths
                and messages
              example:
                - path:
                    - model
                  message: 'Missing required field: model'
                - path:
                    - messages
                    - '0'
                    - content
                  message: Invalid message content format
          required:
            - message
            - code
            - status
      required:
        - error
  securitySchemes:
    Auth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication used for standard API calls. Format: 'Bearer
        YOUR_API_KEY'

````