Portkey · Capability

Portkey API

The Portkey REST API. Please see https://portkey.ai/docs/api-reference for more details.

Run with Naftiko PortkeyAPI

What You Can Do

POST
Createchatcompletion — Chat
/chat/completions
GET
Connectrealtime — Realtime
/realtime
POST
Createcompletion — Completions
/completions
POST
Post collections — Create a new collection
/collections
GET
Get collections — List collections
/collections
GET
Get collections collectionid — Get collection details
/collections/{collectionId}
PUT
Put collections collectionid — Update collection
/collections/{collectionId}
DELETE
Delete collections collectionid — Delete collection
/collections/{collectionId}
POST
Createlabel — Create a new label
/labels
GET
Listlabels — List labels
/labels
GET
Getlabel — Get a label by ID
/labels/{labelId}
PUT
Updatelabel — Update a label
/labels/{labelId}
DELETE
Deletelabel — Delete a label
/labels/{labelId}
POST
Createprompt — Create a new prompt
/prompts
GET
Listprompts — List prompts
/prompts
GET
Getprompt — Get a prompt by ID or slug
/prompts/{promptId}
PUT
Updateprompt — Update a prompt
/prompts/{promptId}
DELETE
Deleteprompt — Delete a prompt
/prompts/{promptId}
GET
Getpromptversions — Get all versions of a prompt
/prompts/{promptId}/versions
GET
Getpromptbyversion — Get a specific version of a prompt
/prompts/{promptId}/versions/{versionId}
PUT
Updatepromptversion — Update a specific version of a prompt
/prompts/{promptId}/versions/{versionId}
PUT
Updatepromptdefault — Set a version as the default for a prompt
/prompts/{promptId}/makeDefault
POST
Createpromptpartial — Create a new prompt partial
/prompts/partials
GET
Listpromptpartials — List prompt partials
/prompts/partials
GET
Getpromptpartial — Get a prompt partial by ID or slug
/prompts/partials/{promptPartialId}
PUT
Updatepromptpartial — Update a prompt partial
/prompts/partials/{promptPartialId}
DELETE
Deletepromptpartial — Delete a prompt partial
/prompts/partials/{promptPartialId}
GET
Getpromptpartialversions — Get all versions of a prompt partial
/prompts/partials/{promptPartialId}/versions
PUT
Updatepromptpartialdefault — Set a version as the default for a prompt partial
/prompts/partials/{promptPartialId}/makeDefault
POST
Createpromptcompletion — Prompts Completions
/prompts/{promptId}/completions
POST
Createpromptrender — Prompts Render
/prompts/{promptId}/render
POST
Createguardrail — Create a new guardrail
/guardrails
GET
Listguardrails — List guardrails
/guardrails
GET
Getguardrail — Get a specific guardrail
/guardrails/{guardrailId}
PUT
Updateguardrail — Update a guardrail
/guardrails/{guardrailId}
DELETE
Deleteguardrail — Delete a guardrail
/guardrails/{guardrailId}
POST
Createimage — Create Image
/images/generations
POST
Createimageedit — Create Image Edit
/images/edits
POST
Createimagevariation — Creates Image Variation
/images/variations
POST
Createembedding — Embeddings
/embeddings
POST
Creatererank — Rerank
/rerank
POST
Createspeech — Create Speech
/audio/speech
POST
Createtranscription — Create Transcription
/audio/transcriptions
POST
Createtranslation — Create Translation
/audio/translations
GET
Listfiles — List Files
/files
POST
Createfile — Upload a file to be used across various endpoints, such as Assistant (<2M tokens), Fine-Tuning, and Batch (<100 MB). Total size of your bucket is 100 GB.
/files
DELETE
Deletefile — Delete File
/files/{file_id}
GET
Retrievefile — Returns information about a specific file.
/files/{file_id}
GET
Downloadfile — Returns the contents of the specified file.
/files/{file_id}/content
POST
Createfinetuningjob — Create a Finetune Job
/fine_tuning/jobs
GET
Listpaginatedfinetuningjobs — List your organization's fine-tuning jobs
/fine_tuning/jobs
GET
Retrievefinetuningjob — Get info about a fine-tuning job. [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
/fine_tuning/jobs/{fine_tuning_job_id}
GET
Listfinetuningevents — Get status updates for a fine-tuning job.
/fine_tuning/jobs/{fine_tuning_job_id}/events
POST
Cancelfinetuningjob — Immediately cancel a fine-tune job.
/fine_tuning/jobs/{fine_tuning_job_id}/cancel
GET
Listfinetuningjobcheckpoints — List checkpoints for a fine-tuning job.
/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints
GET
Listmodels — List Available Models
/models
GET
Retrievemodel — Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
/models/{model}
DELETE
Deletemodel — Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
/models/{model}
POST
Createmoderation — Identify potentially harmful content in text and images. **Only** works with [OpenAI's Moderations endpoint](https://platform.openai.com/docs/guides/moderation) currently.
/moderations
GET
Listassistants — Returns a list of assistants.
/assistants

MCP Tools

createchatcompletion

Chat

connectrealtime

Realtime

read-only idempotent
createcompletion

Completions

post-collections

Create a new collection

get-collections

List collections

read-only idempotent
get-collections-collectionid

Get collection details

read-only idempotent
put-collections-collectionid

Update collection

idempotent
delete-collections-collectionid

Delete collection

idempotent
createlabel

Create a new label

listlabels

List labels

read-only idempotent
getlabel

Get a label by ID

read-only idempotent
updatelabel

Update a label

idempotent
deletelabel

Delete a label

idempotent
createprompt

Create a new prompt

listprompts

List prompts

read-only idempotent
getprompt

Get a prompt by ID or slug

read-only idempotent
updateprompt

Update a prompt

idempotent
deleteprompt

Delete a prompt

idempotent
getpromptversions

Get all versions of a prompt

read-only idempotent
getpromptbyversion

Get a specific version of a prompt

read-only idempotent
updatepromptversion

Update a specific version of a prompt

idempotent
updatepromptdefault

Set a version as the default for a prompt

idempotent
createpromptpartial

Create a new prompt partial

listpromptpartials

List prompt partials

read-only idempotent
getpromptpartial

Get a prompt partial by ID or slug

read-only idempotent
updatepromptpartial

Update a prompt partial

idempotent
deletepromptpartial

Delete a prompt partial

idempotent
getpromptpartialversions

Get all versions of a prompt partial

read-only idempotent
updatepromptpartialdefault

Set a version as the default for a prompt partial

idempotent
createpromptcompletion

Prompts Completions

createpromptrender

Prompts Render

createguardrail

Create a new guardrail

listguardrails

List guardrails

read-only idempotent
getguardrail

Get a specific guardrail

read-only idempotent
updateguardrail

Update a guardrail

idempotent
deleteguardrail

Delete a guardrail

idempotent
createimage

Create Image

createimageedit

Create Image Edit

createimagevariation

Creates Image Variation

createembedding

Embeddings

creatererank

Rerank

createspeech

Create Speech

createtranscription

Create Transcription

createtranslation

Create Translation

listfiles

List Files

read-only idempotent
createfile

Upload a file to be used across various endpoints, such as Assistant (<2M tokens), Fine-Tuning, and Batch (<100 MB). Total size of your bucket is 100 GB.

deletefile

Delete File

idempotent
retrievefile

Returns information about a specific file.

read-only idempotent
downloadfile

Returns the contents of the specified file.

read-only idempotent
createfinetuningjob

Create a Finetune Job

listpaginatedfinetuningjobs

List your organization's fine-tuning jobs

read-only idempotent
retrievefinetuningjob

Get info about a fine-tuning job. [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)

read-only idempotent
listfinetuningevents

Get status updates for a fine-tuning job.

read-only idempotent
cancelfinetuningjob

Immediately cancel a fine-tune job.

listfinetuningjobcheckpoints

List checkpoints for a fine-tuning job.

read-only idempotent
listmodels

List Available Models

read-only idempotent
retrievemodel

Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

read-only idempotent
deletemodel

Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.

idempotent
createmoderation

Identify potentially harmful content in text and images. **Only** works with [OpenAI's Moderations endpoint](https://platform.openai.com/docs/guides/moderation) currently.

listassistants

Returns a list of assistants.

read-only idempotent

Capability Spec

portkey-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Portkey API
  description: The Portkey REST API. Please see https://portkey.ai/docs/api-reference for more details.
  tags:
  - Portkey
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: portkey
    baseUri: https://api.portkey.ai/v1
    description: Portkey API HTTP API.
    authentication:
      type: apikey
      in: header
      name: x-portkey-api-key
      value: '{{PORTKEY_TOKEN}}'
    resources:
    - name: chat-completions
      path: /chat/completions
      operations:
      - name: createchatcompletion
        method: POST
        description: Chat
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: realtime
      path: /realtime
      operations:
      - name: connectrealtime
        method: GET
        description: Realtime
        inputParameters:
        - name: model
          in: query
          type: string
          description: Often required for OpenAI-style realtime; other query params pass through unchanged.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: completions
      path: /completions
      operations:
      - name: createcompletion
        method: POST
        description: Completions
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: collections
      path: /collections
      operations:
      - name: post-collections
        method: POST
        description: Create a new collection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: get-collections
        method: GET
        description: List collections
        inputParameters:
        - name: workspace_id
          in: query
          type: string
          required: true
          description: ID or slug of the workspace
        - name: current_page
          in: query
          type: integer
          description: Page number for pagination (0-indexed)
        - name: page_size
          in: query
          type: integer
          description: Number of items per page
        - name: search
          in: query
          type: string
          description: Search query to filter collections by name
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: collections-collectionid
      path: /collections/{collectionId}
      operations:
      - name: get-collections-collectionid
        method: GET
        description: Get collection details
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: put-collections-collectionid
        method: PUT
        description: Update collection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: delete-collections-collectionid
        method: DELETE
        description: Delete collection
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: labels
      path: /labels
      operations:
      - name: createlabel
        method: POST
        description: Create a new label
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: listlabels
        method: GET
        description: List labels
        inputParameters:
        - name: organisation_id
          in: query
          type: string
          description: ID of the organisation
        - name: workspace_id
          in: query
          type: string
          description: ID or slug of the workspace
        - name: search
          in: query
          type: string
          description: Search query to filter labels by name
        - name: current_page
          in: query
          type: integer
          description: Page number for pagination
        - name: page_size
          in: query
          type: integer
          description: Number of items per page
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: labels-labelid
      path: /labels/{labelId}
      operations:
      - name: getlabel
        method: GET
        description: Get a label by ID
        inputParameters:
        - name: labelId
          in: path
          type: string
          required: true
          description: ID of the label to retrieve
        - name: organisation_id
          in: query
          type: string
          description: ID of the organisation
        - name: workspace_id
          in: query
          type: string
          description: ID or slug of the workspace
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatelabel
        method: PUT
        description: Update a label
        inputParameters:
        - name: labelId
          in: path
          type: string
          required: true
          description: ID of the label to update
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deletelabel
        method: DELETE
        description: Delete a label
        inputParameters:
        - name: labelId
          in: path
          type: string
          required: true
          description: ID of the label to delete
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts
      path: /prompts
      operations:
      - name: createprompt
        method: POST
        description: Create a new prompt
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: listprompts
        method: GET
        description: List prompts
        inputParameters:
        - name: collection_id
          in: query
          type: string
        - name: workspace_id
          in: query
          type: string
        - name: current_page
          in: query
          type: integer
        - name: page_size
          in: query
          type: integer
        - name: search
          in: query
          type: string
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-promptid
      path: /prompts/{promptId}
      operations:
      - name: getprompt
        method: GET
        description: Get a prompt by ID or slug
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updateprompt
        method: PUT
        description: Update a prompt
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deleteprompt
        method: DELETE
        description: Delete a prompt
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-promptid-versions
      path: /prompts/{promptId}/versions
      operations:
      - name: getpromptversions
        method: GET
        description: Get all versions of a prompt
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-promptid-versions-versionid
      path: /prompts/{promptId}/versions/{versionId}
      operations:
      - name: getpromptbyversion
        method: GET
        description: Get a specific version of a prompt
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
        - name: versionId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatepromptversion
        method: PUT
        description: Update a specific version of a prompt
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
        - name: versionId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-promptid-makedefault
      path: /prompts/{promptId}/makeDefault
      operations:
      - name: updatepromptdefault
        method: PUT
        description: Set a version as the default for a prompt
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-partials
      path: /prompts/partials
      operations:
      - name: createpromptpartial
        method: POST
        description: Create a new prompt partial
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: listpromptpartials
        method: GET
        description: List prompt partials
        inputParameters:
        - name: collection_id
          in: query
          type: string
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-partials-promptpartialid
      path: /prompts/partials/{promptPartialId}
      operations:
      - name: getpromptpartial
        method: GET
        description: Get a prompt partial by ID or slug
        inputParameters:
        - name: promptPartialId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatepromptpartial
        method: PUT
        description: Update a prompt partial
        inputParameters:
        - name: promptPartialId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deletepromptpartial
        method: DELETE
        description: Delete a prompt partial
        inputParameters:
        - name: promptPartialId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-partials-promptpartialid-versions
      path: /prompts/partials/{promptPartialId}/versions
      operations:
      - name: getpromptpartialversions
        method: GET
        description: Get all versions of a prompt partial
        inputParameters:
        - name: promptPartialId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-partials-promptpartialid-makedefault
      path: /prompts/partials/{promptPartialId}/makeDefault
      operations:
      - name: updatepromptpartialdefault
        method: PUT
        description: Set a version as the default for a prompt partial
        inputParameters:
        - name: promptPartialId
          in: path
          type: string
          required: true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-promptid-completions
      path: /prompts/{promptId}/completions
      operations:
      - name: createpromptcompletion
        method: POST
        description: Prompts Completions
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
          description: The unique identifier of the prompt template to use
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: prompts-promptid-render
      path: /prompts/{promptId}/render
      operations:
      - name: createpromptrender
        method: POST
        description: Prompts Render
        inputParameters:
        - name: promptId
          in: path
          type: string
          required: true
          description: The unique identifier of the prompt template to render
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: guardrails
      path: /guardrails
      operations:
      - name: createguardrail
        method: POST
        description: Create a new guardrail
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: listguardrails
        method: GET
        description: List guardrails
        inputParameters:
        - name: workspace_id
          in: query
          type: string
          description: Workspace UUID to filter guardrails
        - name: organisation_id
          in: query
          type: string
          description: Organisation UUID to filter guardrails
        - name: page_size
          in: query
          type: integer
          description: Number of items per page
        - name: current_page
          in: query
          type: integer
          description: Current page number (0-indexed)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: guardrails-guardrailid
      path: /guardrails/{guardrailId}
      operations:
      - name: getguardrail
        method: GET
        description: Get a specific guardrail
        inputParameters:
        - name: guardrailId
          in: path
          type: string
          required: true
          description: Guardrail UUID or slug (with guard_ prefix)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updateguardrail
        method: PUT
        description: Update a guardrail
        inputParameters:
        - name: guardrailId
          in: path
          type: string
          required: true
          description: Guardrail UUID or slug to update
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deleteguardrail
        method: DELETE
        description: Delete a guardrail
        inputParameters:
        - name: guardrailId
          in: path
          type: string
          required: true
          description: Guardrail UUID or slug to delete
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: images-generations
      path: /images/generations
      operations:
      - name: createimage
        method: POST
        description: Create Image
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: images-edits
      path: /images/edits
      operations:
      - name: createimageedit
        method: POST
        description: Create Image Edit
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: images-variations
      path: /images/variations
      operations:
      - name: createimagevariation
        method: POST
        description: Creates Image Variation
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: embeddings
      path: /embeddings
      operations:
      - name: createembedding
        method: POST
        description: Embeddings
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: rerank
      path: /rerank
      operations:
      - name: creatererank
        method: POST
        description: Rerank
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: audio-speech
      path: /audio/speech
      operations:
      - name: createspeech
        method: POST
        description: Create Speech
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: audio-transcriptions
      path: /audio/transcriptions
      operations:
      - name: createtranscription
        method: POST
        description: Create Transcription
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: audio-translations
      path: /audio/translations
      operations:
      - name: createtranslation
        method: POST
        description: Create Translation
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: files
      path: /files
      operations:
      - name: listfiles
        method: GET
        description: List Files
        inputParameters:
        - name: purpose
          in: query
          type: string
          description: Only return files with the given purpose.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createfile
        method: POST
        description: Upload a file to be used across various endpoints, such as Assistant (<2M tokens), Fine-Tuning, and Batch
          (<100 MB). Total size of your bucket is 100 GB.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: files-file-id
      path: /files/{file_id}
      operations:
      - name: deletefile
        method: DELETE
        description: Delete File
        inputParameters:
        - name: file_id
          in: path
          type: string
          required: true
          description: The ID of the file to use for this request.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: retrievefile
        method: GET
        description: Returns information about a specific file.
        inputParameters:
        - name: file_id
          in: path
          type: string
          required: true
          description: The ID of the file to use for this request.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: files-file-id-content
      path: /files/{file_id}/content
      operations:
      - name: downloadfile
        method: GET
        description: Returns the contents of the specified file.
        inputParameters:
        - name: file_id
          in: path
          type: string
          required: true
          description: The ID of the file to use for this request.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: fine-tuning-jobs
      path: /fine_tuning/jobs
      operations:
      - name: createfinetuningjob
        method: POST
        description: Create a Finetune Job
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: listpaginatedfinetuningjobs
        method: GET
        description: List your organization's fine-tuning jobs
        inputParameters:
        - name: after
          in: query
          type: string
          description: Identifier for the last job from the previous pagination request.
        - name: limit
          in: query
          type: integer
          description: Number of fine-tuning jobs to retrieve.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: fine-tuning-jobs-fine-tuning-job-id
      path: /fine_tuning/jobs/{fine_tuning_job_id}
      operations:
      - name: retrievefinetuningjob
        method: GET
        description: Get info about a fine-tuning job. [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
        inputParameters:
        - name: fine_tuning_job_id
          in: path
          type: string
          required: true
          description: The ID of the fine-tuning job.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: fine-tuning-jobs-fine-tuning-job-id-events
      path: /fine_tuning/jobs/{fine_tuning_job_id}/events
      operations:
      - name: listfinetuningevents
        method: GET
        description: Get status updates for a fine-tuning job.
        inputParameters:
        - name: fine_tuning_job_id
          in: path
          type: string
          required: true
          description: The ID of the fine-tuning job to get events for.
        - name: after
          in: query
          type: string
          description: Identifier for the last event from the previous pagination request.
        - name: limit
          in: query
          type: integer
          description: Number of events to retrieve.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: fine-tuning-jobs-fine-tuning-job-id-cancel
      path: /fine_tuning/jobs/{fine_tuning_job_id}/cancel
      operations:
      - name: cancelfinetuningjob
        method: POST
        description: Immediately cancel a fine-tune job.
        inputParameters:
        - name: fine_tuning_job_id
          in: path
          type: string
          required: true
          description: The ID of the fine-tuning job to cancel.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: fine-tuning-jobs-fine-tuning-job-id-checkpoints
      path: /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints
      operations:
      - name: listfinetuningjobcheckpoints
        method: GET
        description: List checkpoints for a fine-tuning job.
        inputParameters:
        - name: fine_tuning_job_id
          in: path
          type: string
          required: true
          description: The ID of the fine-tuning job to get checkpoints for.
        - name: after
          in: query
          type: string
          description: Identifier for the last checkpoint ID from the previous pagination request.
        - name: limit
          in: query
          type: integer
          description: Number of checkpoints to retrieve.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: models
      path: /models
      operations:
      - name: listmodels
        method: GET
        description: List Available Models
        inputParameters:
        - name: ai_service
          in: query
          type: string
          description: Filter models by the AI service (e.g., 'openai', 'anthropic').
        - name: provider
          in: query
          type: string
          description: Filter models by the provider.
        - name: limit
          in: query
          type: integer
          description: The maximum number of models to return.
        - name: offset
          in: query
          type: integer
          description: The number of models to skip before starting to collect the result set.
        - name: sort
          in: query
          type: string
          description: The field to sort the results by.
        - name: order
          in: query
          type: string
          description: The order to sort the results in.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: models-model
      path: /models/{model}
      operations:
      - name: retrievemodel
        method: GET
        description: Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
        inputParameters:
        - name: model
          in: path
          type: string
          required: true
          description: The ID of the model to use for this request
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deletemodel
        method: DELETE
        description: Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
        inputParameters:
        - name: model
          in: path
          type: string
          required: true
          description: The model to delete
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: moderations
      path: /moderations
      operations:
      - name: createmoderation
        method: POST
        description: Identify potentially harmful content in text and images. **Only** works with [OpenAI's Moderations endpoint](https://platform.openai.com/docs/guides/moderation)
          currently.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: assistants
      path: /assistants
      operations:
      - name: listassistants
        method: GET
        description: Returns a list of assistants.
        inputParameters:
        - name: limit
          in: query
          type: integer
          description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default
            is 20.
        - name: order
          in: query
          type: string
          description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending
            order.
        - name: after
          in: query
          type: string
          description: A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance,
            if you make a list request and receive 100 objects, e
        - name: before
          in: query
          type: string
          description: 'A cursor for use in pagination. `before` is an object ID that defines your place in the list. For
            instance, if you make a list request and receive 100 objects, '
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: portkey-rest
    description: REST adapter for Portkey API.
    resources:
    - path: /chat/completions
      name: createchatcompletion
      operations:
      - method: POST
        name: createchatcompletion
        description: Chat
        call: portkey.createchatcompletion
        outputParameters:
        - type: object
          mapping: $.
    - path: /realtime
      name: connectrealtime
      operations:
      - method: GET
        name: connectrealtime
        description: Realtime
        call: portkey.connectrealtime
        outputParameters:
        - type: object
          mapping: $.
    - path: /completions
      name: createcompletion
      operations:
      - method: POST
        name: createcompletion
        description: Completions
        call: portkey.createcompletion
        outputParameters:
        - type: object
          mapping: $.
    - path: /collections
      name: post-collections
      operations:
      - method: POST
        name: post-collections
        description: Create a new collection
        call: portkey.post-collections
        outputParameters:
        - type: object
          mapping: $.
    - path: /collections
      name: get-collections
      operations:
      - method: GET
        name: get-collections
        description: List collections
        call: portkey.get-collections
        outputParameters:
        - type: object
          mapping: $.
    - path: /collections/{collectionId}
      name: get-collections-collectionid
      operations:
      - method: GET
        name: get-collections-collectionid
        description: Get collection details
        call: portkey.get-collections-collectionid
        outputParameters:
        - type: object
          mapping: $.
    - path: /collections/{collectionId}
      name: put-collections-collectionid
      operations:
      - method: PUT
        name: put-collections-collectionid
        description: Update collection
        call: portkey.put-collections-collectionid
        outputParameters:
        - type: object
          mapping: $.
    - path: /collections/{collectionId}
      name: delete-collections-collectionid
      operations:
      - method: DELETE
        name: delete-collections-collectionid
        description: Delete collection
        call: portkey.delete-collections-collectionid
        outputParameters:
        - type: object
          mapping: $.
    - path: /labels
      name: createlabel
      operations:
      - method: POST
        name: createlabel
        description: Create a new label
        call: portkey.createlabel
        outputParameters:
        - type: object
          mapping: $.
    - path: /labels
      name: listlabels
      operations:
      - method: GET
        name: listlabels
        description: List labels
        call: portkey.listlabels
        outputParameters:
        - type: object
          mapping: $.
    - path: /labels/{labelId}
      name: getlabel
      operations:
      - method: GET
        name: getlabel
        description: Get a label by ID
        call: portkey.getlabel
        with:
          labelId: rest.labelId
        outputParameters:
        - type: object
          mapping: $.
    - path: /labels/{labelId}
      name: updatelabel
      operations:
      - method: PUT
        name: updatelabel
        description: Update a label
        call: portkey.updatelabel
        with:
          labelId: rest.labelId
        outputParameters:
        - type: object
          mapping: $.
    - path: /labels/{labelId}
      name: deletelabel
      operations:
      - method: DELETE
        name: deletelabel
        description: Delete a label
        call: portkey.deletelabel
        with:
          labelId: rest.labelId
        outputParameters:
        - type: object
          mapping: $.
    - path: /prompts
      name: createprompt
      operations:
      - method: POST
        name: createprompt
        description: Create a new prompt
        call: portkey.createprompt
        outputParameters:
        - type: object
          mapping: $.
    - path: /prompts
      name: listprompts
      operations:
      - method: GET
        name: listprompts
        description: List prompts
        call: portkey.listprompts
        outputParameters:
        - type: object
          mapping: $.
    - path: /prompts/{promptId}
      name: getprompt
      operations:
      - method: GET
        name: getprompt
        description: Get a prompt by ID or slug
        call: portkey.getprompt
        with:
          promptId: rest.promptId
        outputParameters:
        - type: object
          mapping: $.
    - path: /prompts/{promptId}
      name: updateprompt
      operations:
      - method: PUT
        name: updateprompt
        description: Update a prompt
        call: portkey.updateprompt
        with:
          promptId: rest.promptId
        outputParameters:
        - type: object
          mapping: $.
 

# --- truncated at 32 KB (73 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/portkey/refs/heads/main/capabilities/portkey-capability.yaml