OpenRouter · Capability

OpenRouter API — Chat

OpenRouter API — Chat. 1 operations. Lead operation: Create chat completion. Self-contained Naftiko capability covering one Openrouter business surface.

Run with Naftiko OpenrouterChat

What You Can Do

POST
Createchatcompletion — Create chat completion
/v1/chat/completions

MCP Tools

create-chat-completion

Create chat completion

Capability Spec

openrouter-chat.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: OpenRouter API — Chat
  description: 'OpenRouter API — Chat. 1 operations. Lead operation: Create chat completion. Self-contained Naftiko capability
    covering one Openrouter business surface.'
  tags:
  - Openrouter
  - Chat
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    OPENROUTER_API_KEY: OPENROUTER_API_KEY
capability:
  consumes:
  - type: http
    namespace: openrouter-chat
    baseUri: https://openrouter.ai/api/v1
    description: OpenRouter API — Chat business capability. Self-contained, no shared references.
    resources:
    - name: chat-completions
      path: /chat/completions
      operations:
      - name: createchatcompletion
        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.OPENROUTER_API_KEY}}'
  exposes:
  - type: rest
    namespace: openrouter-chat-rest
    port: 8080
    description: REST adapter for OpenRouter API — Chat. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/chat/completions
      name: chat-completions
      description: REST surface for chat-completions.
      operations:
      - method: POST
        name: createchatcompletion
        description: Create chat completion
        call: openrouter-chat.createchatcompletion
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: openrouter-chat-mcp
    port: 9090
    transport: http
    description: MCP adapter for OpenRouter 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: openrouter-chat.createchatcompletion
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.