Portkey · Capability

Portkey API — Virtual-keys

Portkey API — Virtual-keys. 5 operations. Lead operation: List All Virtual Keys. Self-contained Naftiko capability covering one Portkey business surface.

Run with Naftiko PortkeyVirtual-keys

What You Can Do

GET
Get — List All Virtual Keys
/v1/virtual-keys
POST
Post — Create a Virtual Key
/v1/virtual-keys
GET
Get — Get a Virtual Key
/v1/virtual-keys/{slug}
PUT
Put — Update a Virtual Key
/v1/virtual-keys/{slug}
DELETE
Delete — Delete a Virtual Key
/v1/virtual-keys/{slug}

MCP Tools

list-all-virtual-keys

List All Virtual Keys

read-only idempotent
create-virtual-key

Create a Virtual Key

get-virtual-key

Get a Virtual Key

read-only idempotent
update-virtual-key

Update a Virtual Key

idempotent
delete-virtual-key

Delete a Virtual Key

idempotent

Capability Spec

portkey-virtual-keys.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Portkey API — Virtual-keys
  description: 'Portkey API — Virtual-keys. 5 operations. Lead operation: List All Virtual Keys. Self-contained Naftiko capability
    covering one Portkey business surface.'
  tags:
  - Portkey
  - Virtual-keys
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    PORTKEY_API_KEY: PORTKEY_API_KEY
capability:
  consumes:
  - type: http
    namespace: portkey-virtual-keys
    baseUri: https://api.portkey.ai/v1
    description: Portkey API — Virtual-keys business capability. Self-contained, no shared references.
    resources:
    - name: virtual-keys
      path: /virtual-keys
      operations:
      - name: get
        method: GET
        description: List All Virtual Keys
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: current_page
          in: query
          type: integer
          description: Current page, defaults to 0
          required: true
        - name: page_size
          in: query
          type: integer
          description: Page size, default to 50
          required: true
      - name: post
        method: POST
        description: Create a Virtual Key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: virtual-keys-slug
      path: /virtual-keys/{slug}
      operations:
      - name: get
        method: GET
        description: Get a Virtual Key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: slug
          in: path
          type: string
          required: true
      - name: put
        method: PUT
        description: Update a Virtual Key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: slug
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: delete
        method: DELETE
        description: Delete a Virtual Key
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: slug
          in: path
          type: string
          required: true
    authentication:
      type: bearer
      token: '{{env.PORTKEY_API_KEY}}'
  exposes:
  - type: rest
    namespace: portkey-virtual-keys-rest
    port: 8080
    description: REST adapter for Portkey API — Virtual-keys. One Spectral-compliant resource per consumed operation, prefixed
      with /v1.
    resources:
    - path: /v1/virtual-keys
      name: virtual-keys
      description: REST surface for virtual-keys.
      operations:
      - method: GET
        name: get
        description: List All Virtual Keys
        call: portkey-virtual-keys.get
        with:
          current_page: rest.current_page
          page_size: rest.page_size
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: post
        description: Create a Virtual Key
        call: portkey-virtual-keys.post
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/virtual-keys/{slug}
      name: virtual-keys-slug
      description: REST surface for virtual-keys-slug.
      operations:
      - method: GET
        name: get
        description: Get a Virtual Key
        call: portkey-virtual-keys.get
        with:
          slug: rest.slug
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: Update a Virtual Key
        call: portkey-virtual-keys.put
        with:
          slug: rest.slug
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: delete
        description: Delete a Virtual Key
        call: portkey-virtual-keys.delete
        with:
          slug: rest.slug
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: portkey-virtual-keys-mcp
    port: 9090
    transport: http
    description: MCP adapter for Portkey API — Virtual-keys. One tool per consumed operation, routed inline through this capability's
      consumes block.
    tools:
    - name: list-all-virtual-keys
      description: List All Virtual Keys
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-virtual-keys.get
      with:
        current_page: tools.current_page
        page_size: tools.page_size
      outputParameters:
      - type: object
        mapping: $.
    - name: create-virtual-key
      description: Create a Virtual Key
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: portkey-virtual-keys.post
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-virtual-key
      description: Get a Virtual Key
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: portkey-virtual-keys.get
      with:
        slug: tools.slug
      outputParameters:
      - type: object
        mapping: $.
    - name: update-virtual-key
      description: Update a Virtual Key
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: portkey-virtual-keys.put
      with:
        slug: tools.slug
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-virtual-key
      description: Delete a Virtual Key
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: portkey-virtual-keys.delete
      with:
        slug: tools.slug
      outputParameters:
      - type: object
        mapping: $.