Moonshot AI · Capability

Moonshot AI API — Chat

Moonshot AI API — Chat. 1 operations. Lead operation: Create Chat Completion. Self-contained Naftiko capability covering one Moonshot Ai business surface.

Run with Naftiko Moonshot AiChat

What You Can Do

POST
Post — Create Chat Completion
/v1/v1/chat/completions

MCP Tools

create-chat-completion

Create Chat Completion

Capability Spec

moonshot-ai-chat.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Moonshot AI API — Chat
  description: 'Moonshot AI API — Chat. 1 operations. Lead operation: Create Chat Completion. Self-contained Naftiko capability
    covering one Moonshot Ai business surface.'
  tags:
  - Moonshot Ai
  - Chat
  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-chat
    baseUri: https://api.moonshot.ai
    description: Moonshot AI API — Chat business capability. Self-contained, no shared references.
    resources:
    - name: v1-chat-completions
      path: /v1/chat/completions
      operations:
      - name: post
        method: POST
        description: Create Chat Completion
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: bearer
      token: '{{env.MOONSHOT_AI_API_KEY}}'
  exposes:
  - type: rest
    namespace: moonshot-ai-chat-rest
    port: 8080
    description: REST adapter for Moonshot AI API — Chat. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/v1/chat/completions
      name: v1-chat-completions
      description: REST surface for v1-chat-completions.
      operations:
      - method: POST
        name: post
        description: Create Chat Completion
        call: moonshot-ai-chat.post
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: moonshot-ai-chat-mcp
    port: 9090
    transport: http
    description: MCP adapter for Moonshot AI API — Chat. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: create-chat-completion
      description: Create Chat Completion
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: moonshot-ai-chat.post
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.