Moonshot AI · Capability

Moonshot AI API — Files

Moonshot AI API — Files. 5 operations. Lead operation: Upload File. Self-contained Naftiko capability covering one Moonshot Ai business surface.

Run with Naftiko Moonshot AiFiles

What You Can Do

POST
Post — Upload File
/v1/v1/files
GET
Get — List Files
/v1/v1/files
GET
Get — Get File Information
/v1/v1/files/{file-id}
DELETE
Delete — Delete File
/v1/v1/files/{file-id}
GET
Get — Get File Content
/v1/v1/files/{file-id}/content

MCP Tools

upload-file

Upload File

list-files

List Files

read-only idempotent
get-file-information

Get File Information

read-only idempotent
delete-file

Delete File

idempotent
get-file-content

Get File Content

read-only idempotent

Capability Spec

moonshot-ai-files.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Moonshot AI API — Files
  description: 'Moonshot AI API — Files. 5 operations. Lead operation: Upload File. Self-contained Naftiko capability covering
    one Moonshot Ai business surface.'
  tags:
  - Moonshot Ai
  - Files
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    MOONSHOT_AI_API_KEY: MOONSHOT_AI_API_KEY
capability:
  consumes:
  - type: http
    namespace: moonshot-ai-files
    baseUri: https://api.moonshot.ai
    description: Moonshot AI API — Files business capability. Self-contained, no shared references.
    resources:
    - name: v1-files
      path: /v1/files
      operations:
      - name: post
        method: POST
        description: Upload File
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: get
        method: GET
        description: List Files
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: v1-files-file_id
      path: /v1/files/{file_id}
      operations:
      - name: get
        method: GET
        description: Get File Information
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The file identifier
          required: true
      - name: delete
        method: DELETE
        description: Delete File
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The file identifier
          required: true
    - name: v1-files-file_id-content
      path: /v1/files/{file_id}/content
      operations:
      - name: get
        method: GET
        description: Get File Content
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: file_id
          in: path
          type: string
          description: The file identifier
          required: true
    authentication:
      type: bearer
      token: '{{env.MOONSHOT_AI_API_KEY}}'
  exposes:
  - type: rest
    namespace: moonshot-ai-files-rest
    port: 8080
    description: REST adapter for Moonshot AI API — Files. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/v1/files
      name: v1-files
      description: REST surface for v1-files.
      operations:
      - method: POST
        name: post
        description: Upload File
        call: moonshot-ai-files.post
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: get
        description: List Files
        call: moonshot-ai-files.get
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/files/{file-id}
      name: v1-files-file-id
      description: REST surface for v1-files-file_id.
      operations:
      - method: GET
        name: get
        description: Get File Information
        call: moonshot-ai-files.get
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: delete
        description: Delete File
        call: moonshot-ai-files.delete
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/files/{file-id}/content
      name: v1-files-file-id-content
      description: REST surface for v1-files-file_id-content.
      operations:
      - method: GET
        name: get
        description: Get File Content
        call: moonshot-ai-files.get
        with:
          file_id: rest.file_id
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: moonshot-ai-files-mcp
    port: 9090
    transport: http
    description: MCP adapter for Moonshot AI API — Files. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: upload-file
      description: Upload File
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: moonshot-ai-files.post
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-files
      description: List Files
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: moonshot-ai-files.get
      outputParameters:
      - type: object
        mapping: $.
    - name: get-file-information
      description: Get File Information
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: moonshot-ai-files.get
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-file
      description: Delete File
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: moonshot-ai-files.delete
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.
    - name: get-file-content
      description: Get File Content
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: moonshot-ai-files.get
      with:
        file_id: tools.file_id
      outputParameters:
      - type: object
        mapping: $.