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

# Create Skill

> Create a skill from a file, prompt, or chat session.

Three creation modes (provide exactly one source):
A. file_id: Use an already-uploaded skill zip (must contain SKILL.md).
B. prompt (+ optional json_schema): Auto-generate SKILL.md and schema.json, package and upload.
C. session_id: Retrieve chat history as the prompt, auto-generate SKILL.md.

All modes produce a skill zip stored in GCS and deduplicate by content hash.

<RequestExample>
  ```python Python theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  !pip install vlmrun

  from vlmrun.client import VLMRun

  client = VLMRun(api_key="<VLMRUN_API_KEY>")

  # Create a skill from a prompt
  skill = client.agent.skills.create(
      prompt="Extract invoice_id, date, and total_amount from invoices.",
      json_schema={
          "type": "object",
          "properties": {
              "invoice_id": {"type": "string"},
              "invoice_date": {"type": "string", "format": "date"},
              "total_amount": {"type": "number"}
          },
          "required": ["invoice_id", "invoice_date", "total_amount"]
      }
  )
  print(f"Created skill: {skill.id} ({skill.name})")

  # Create a skill from a pre-uploaded file
  skill = client.agent.skills.create(
      name="invoice-extraction",
      description="Extract structured data from invoices",
      file_id="<file-id>"  # Uploaded skill zip containing SKILL.md
  )

  # Create a skill from a chat session
  skill = client.agent.skills.create(
      session_id="<session-id>"
  )
  ```

  ```typescript Node.js SDK theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  import { VlmRun } from "vlmrun";

  const client = new VlmRun({
    baseURL: "https://api.vlm.run/v1",
    apiKey: "<VLMRUN_API_KEY>"
  });

  // Create a skill from a prompt
  const skill = await client.agent.skills.create({
    prompt: "Extract invoice_id, date, and total_amount from invoices.",
    jsonSchema: {
      type: "object",
      properties: {
        invoice_id: { type: "string" },
        invoice_date: { type: "string", format: "date" },
        total_amount: { type: "number" }
      },
      required: ["invoice_id", "invoice_date", "total_amount"]
    }
  });
  console.log(skill);
  ```

  ```bash cURL theme={"theme":{"light":"github-light","dark":"dark-plus"}}
  # Create from prompt
  curl -X POST "https://api.vlm.run/v1/skills/create" \
    -H "Authorization: Bearer <VLMRUN_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "Extract invoice_id, date, and total_amount from invoices.",
      "json_schema": {
        "type": "object",
        "properties": {
          "invoice_id": {"type": "string"},
          "invoice_date": {"type": "string", "format": "date"},
          "total_amount": {"type": "number"}
        },
        "required": ["invoice_id", "invoice_date", "total_amount"]
      }
    }'

  # Create from pre-uploaded file
  curl -X POST "https://api.vlm.run/v1/skills/create" \
    -H "Authorization: Bearer <VLMRUN_API_KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "invoice-extraction",
      "description": "Extract structured data from invoices",
      "file_id": "<file-id>"
    }'
  ```
</RequestExample>


## OpenAPI

````yaml POST /v1/skills/create
openapi: 3.1.0
info:
  title: VLM Run Unified Server
  description: Unified server for VLM Run Agent and API
  termsOfService: https://vlm.run/terms-of-service
  contact:
    name: VLM Run Support Team
    url: https://vlm.run/
    email: support@vlm.run
  version: 2026-05-19.0
servers: []
security: []
paths:
  /v1/skills/create:
    post:
      tags:
        - skills
      summary: Create Skill
      description: >-
        Create a skill from a file, prompt, or chat session.


        Three creation modes (provide exactly one source):

        A. file_id: Use an already-uploaded skill zip (must contain SKILL.md).

        B. prompt (+ optional json_schema): Auto-generate SKILL.md and
        schema.json, package and upload.

        C. session_id: Retrieve chat history as the prompt, auto-generate
        SKILL.md.


        All modes produce a skill zip stored in GCS and deduplicate by content
        hash.
      operationId: create_skill_v1_skills_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SkillCreateRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SkillCreateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
          description: >-
            Name of the skill (required for file_id, auto-generated for
            prompt/session_id)
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: >-
            Description of the skill (required for file_id, auto-generated for
            prompt/session_id)
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
          description: File ID from file upload API (the uploaded skill zip)
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
          description: >-
            Prompt text that becomes the SKILL.md body (auto-generates skill
            zip)
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
          description: JSON schema that becomes schema.json in the skill zip
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
          description: Chat session ID to retrieve chat history as the prompt
        is_public:
          type: boolean
          title: Is Public
          description: Whether the skill is publicly accessible
          default: false
      type: object
      title: SkillCreateRequest
      description: >-
        Request to create a skill.


        Three creation modes (provide exactly one):

        A. file_id: Create from a pre-built skill zip uploaded via POST
        /v1/files.

        B. prompt (+ optional json_schema): Auto-generate SKILL.md and
        schema.json.

        C. session_id: Retrieve chat history and auto-generate SKILL.md from
        messages.


        For mode A (file_id), name and description are required.

        For modes B (prompt) and C (session_id), name and description are
        optional —

        if omitted, they are auto-generated by the LLM from the content.
    SkillCreateResponse:
      properties:
        id:
          type: string
          title: Id
          description: ID of the created skill
        name:
          type: string
          title: Name
          description: Name of the skill (may differ from request if LLM-generated)
        description:
          type: string
          title: Description
          description: Description of the skill (may differ from request if LLM-generated)
        skill_version:
          type: string
          title: Skill Version
          description: Auto-generated version of the skill (e.g. '20260512-abc12345')
        status:
          type: string
          title: Status
          description: Status of the skill creation
          default: completed
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Date and time when the skill was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Date and time when the skill was updated
      type: object
      required:
        - id
        - name
        - description
        - skill_version
        - created_at
        - updated_at
      title: SkillCreateResponse
      description: Response for skill creation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````