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: $. - path: /prompts/{promptId} name: deleteprompt operations: - method: DELETE name: deleteprompt description: Delete a prompt call: portkey.deleteprompt with: promptId: rest.promptId outputParameters: - type: object mapping: $. - path: /prompts/{promptId}/versions name: getpromptversions operations: - method: GET name: getpromptversions description: Get all versions of a prompt call: portkey.getpromptversions with: promptId: rest.promptId outputParameters: - type: object mapping: $. - path: /prompts/{promptId}/versions/{versionId} name: getpromptbyversion operations: - method: GET name: getpromptbyversion description: Get a specific version of a prompt call: portkey.getpromptbyversion with: promptId: rest.promptId versionId: rest.versionId outputParameters: - type: object mapping: $. - path: /prompts/{promptId}/versions/{versionId} name: updatepromptversion operations: - method: PUT name: updatepromptversion description: Update a specific version of a prompt call: portkey.updatepromptversion with: promptId: rest.promptId versionId: rest.versionId outputParameters: - type: object mapping: $. - path: /prompts/{promptId}/makeDefault name: updatepromptdefault operations: - method: PUT name: updatepromptdefault description: Set a version as the default for a prompt call: portkey.updatepromptdefault with: promptId: rest.promptId outputParameters: - type: object mapping: $. - path: /prompts/partials name: createpromptpartial operations: - method: POST name: createpromptpartial description: Create a new prompt partial call: portkey.createpromptpartial outputParameters: - type: object mapping: $. - path: /prompts/partials name: listpromptpartials operations: - method: GET name: listpromptpartials description: List prompt partials call: portkey.listpromptpartials outputParameters: - type: object mapping: $. - path: /prompts/partials/{promptPartialId} name: getpromptpartial operations: - method: GET name: getpromptpartial description: Get a prompt partial by ID or slug call: portkey.getpromptpartial with: promptPartialId: rest.promptPartialId outputParameters: - type: object mapping: $. - path: /prompts/partials/{promptPartialId} name: updatepromptpartial operations: - method: PUT name: updatepromptpartial description: Update a prompt partial call: portkey.updatepromptpartial with: promptPartialId: rest.promptPartialId outputParameters: - type: object mapping: $. - path: /prompts/partials/{promptPartialId} name: deletepromptpartial operations: - method: DELETE name: deletepromptpartial description: Delete a prompt partial call: portkey.deletepromptpartial with: promptPartialId: rest.promptPartialId outputParameters: - type: object mapping: $. - path: /prompts/partials/{promptPartialId}/versions name: getpromptpartialversions operations: - method: GET name: getpromptpartialversions description: Get all versions of a prompt partial call: portkey.getpromptpartialversions with: promptPartialId: rest.promptPartialId outputParameters: - type: object mapping: $. - path: /prompts/partials/{promptPartialId}/makeDefault name: updatepromptpartialdefault operations: - method: PUT name: updatepromptpartialdefault description: Set a version as the default for a prompt partial call: portkey.updatepromptpartialdefault with: promptPartialId: rest.promptPartialId outputParameters: - type: object mapping: $. - path: /prompts/{promptId}/completions name: createpromptcompletion operations: - method: POST name: createpromptcompletion description: Prompts Completions call: portkey.createpromptcompletion with: promptId: rest.promptId outputParameters: - type: object mapping: $. - path: /prompts/{promptId}/render name: createpromptrender operations: - method: POST name: createpromptrender description: Prompts Render call: portkey.createpromptrender with: promptId: rest.promptId outputParameters: - type: object mapping: $. - path: /guardrails name: createguardrail operations: - method: POST name: createguardrail description: Create a new guardrail call: portkey.createguardrail outputParameters: - type: object mapping: $. - path: /guardrails name: listguardrails operations: - method: GET name: listguardrails description: List guardrails call: portkey.listguardrails outputParameters: - type: object mapping: $. - path: /guardrails/{guardrailId} name: getguardrail operations: - method: GET name: getguardrail description: Get a specific guardrail call: portkey.getguardrail with: guardrailId: rest.guardrailId outputParameters: - type: object mapping: $. - path: /guardrails/{guardrailId} name: updateguardrail operations: - method: PUT name: updateguardrail description: Update a guardrail call: portkey.updateguardrail with: guardrailId: rest.guardrailId outputParameters: - type: object mapping: $. - path: /guardrails/{guardrailId} name: deleteguardrail operations: - method: DELETE name: deleteguardrail description: Delete a guardrail call: portkey.deleteguardrail with: guardrailId: rest.guardrailId outputParameters: - type: object mapping: $. - path: /images/generations name: createimage operations: - method: POST name: createimage description: Create Image call: portkey.createimage outputParameters: - type: object mapping: $. - path: /images/edits name: createimageedit operations: - method: POST name: createimageedit description: Create Image Edit call: portkey.createimageedit outputParameters: - type: object mapping: $. - path: /images/variations name: createimagevariation operations: - method: POST name: createimagevariation description: Creates Image Variation call: portkey.createimagevariation outputParameters: - type: object mapping: $. - path: /embeddings name: createembedding operations: - method: POST name: createembedding description: Embeddings call: portkey.createembedding outputParameters: - type: object mapping: $. - path: /rerank name: creatererank operations: - method: POST name: creatererank description: Rerank call: portkey.creatererank outputParameters: - type: object mapping: $. - path: /audio/speech name: createspeech operations: - method: POST name: createspeech description: Create Speech call: portkey.createspeech outputParameters: - type: object mapping: $. - path: /audio/transcriptions name: createtranscription operations: - method: POST name: createtranscription description: Create Transcription call: portkey.createtranscription outputParameters: - type: object mapping: $. - path: /audio/translations name: createtranslation operations: - method: POST name: createtranslation description: Create Translation call: portkey.createtranslation outputParameters: - type: object mapping: $. - path: /files name: listfiles operations: - method: GET name: listfiles description: List Files call: portkey.listfiles outputParameters: - type: object mapping: $. - path: /files name: createfile operations: - method: POST name: createfile 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. call: portkey.createfile outputParameters: - type: object mapping: $. - path: /files/{file_id} name: deletefile operations: - method: DELETE name: deletefile description: Delete File call: portkey.deletefile with: file_id: rest.file_id outputParameters: - type: object mapping: $. - path: /files/{file_id} name: retrievefile operations: - method: GET name: retrievefile description: Returns information about a specific file. call: portkey.retrievefile with: file_id: rest.file_id outputParameters: - type: object mapping: $. - path: /files/{file_id}/content name: downloadfile operations: - method: GET name: downloadfile description: Returns the contents of the specified file. call: portkey.downloadfile with: file_id: rest.file_id outputParameters: - type: object mapping: $. - path: /fine_tuning/jobs name: createfinetuningjob operations: - method: POST name: createfinetuningjob description: Create a Finetune Job call: portkey.createfinetuningjob outputParameters: - type: object mapping: $. - path: /fine_tuning/jobs name: listpaginatedfinetuningjobs operations: - method: GET name: listpaginatedfinetuningjobs description: List your organization's fine-tuning jobs call: portkey.listpaginatedfinetuningjobs outputParameters: - type: object mapping: $. - path: /fine_tuning/jobs/{fine_tuning_job_id} name: retrievefinetuningjob operations: - method: GET name: retrievefinetuningjob description: Get info about a fine-tuning job. [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning) call: portkey.retrievefinetuningjob with: fine_tuning_job_id: rest.fine_tuning_job_id outputParameters: - type: object mapping: $. - path: /fine_tuning/jobs/{fine_tuning_job_id}/events name: listfinetuningevents operations: - method: GET name: listfinetuningevents description: Get status updates for a fine-tuning job. call: portkey.listfinetuningevents with: fine_tuning_job_id: rest.fine_tuning_job_id outputParameters: - type: object mapping: $. - path: /fine_tuning/jobs/{fine_tuning_job_id}/cancel name: cancelfinetuningjob operations: - method: POST name: cancelfinetuningjob description: Immediately cancel a fine-tune job. call: portkey.cancelfinetuningjob with: fine_tuning_job_id: rest.fine_tuning_job_id outputParameters: - type: object mapping: $. - path: /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints name: listfinetuningjobcheckpoints operations: - method: GET name: listfinetuningjobcheckpoints description: List checkpoints for a fine-tuning job. call: portkey.listfinetuningjobcheckpoints with: fine_tuning_job_id: rest.fine_tuning_job_id outputParameters: - type: object mapping: $. - path: /models name: listmodels operations: - method: GET name: listmodels description: List Available Models call: portkey.listmodels outputParameters: - type: object mapping: $. - path: /models/{model} name: retrievemodel operations: - method: GET name: retrievemodel description: Retrieves a model instance, providing basic information about the model such as the owner and permissioning. call: portkey.retrievemodel with: model: rest.model outputParameters: - type: object mapping: $. - path: /models/{model} name: deletemodel operations: - method: DELETE name: deletemodel description: Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. call: portkey.deletemodel with: model: rest.model outputParameters: - type: object mapping: $. - path: /moderations name: createmoderation operations: - method: POST name: createmoderation description: Identify potentially harmful content in text and images. **Only** works with [OpenAI's Moderations endpoint](https://platform.openai.com/docs/guides/moderation) currently. call: portkey.createmoderation outputParameters: - type: object mapping: $. - path: /assistants name: listassistants operations: - method: GET name: listassistants description: Returns a list of assistants. call: portkey.listassistants outputParameters: - type: object mapping: $. - type: mcp port: 9090 namespace: portkey-mcp transport: http description: MCP adapter for Portkey API for AI agent use. tools: - name: createchatcompletion description: Chat hints: readOnly: false destructive: false idempotent: false call: portkey.createchatcompletion outputParameters: - type: object mapping: $. - name: connectrealtime description: Realtime hints: readOnly: true destructive: false idempotent: true call: portkey.connectrealtime with: model: tools.model inputParameters: - name: model type: string description: Often required for OpenAI-style realtime; other query params pass through unchanged. outputParameters: - type: object mapping: $. - name: createcompletion description: Completions hints: readOnly: false destructive: false idempotent: false call: portkey.createcompletion outputParameters: - type: object mapping: $. - name: post-collections description: Create a new collection hints: readOnly: false destructive: false idempotent: false call: portkey.post-collections outputParameters: - type: object mapping: $. - name: get-collections description: List collections hints: readOnly: true destructive: false idempotent: true call: portkey.get-collections with: workspace_id: tools.workspace_id current_page: tools.current_page page_size: tools.page_size search: tools.search inputParameters: - name: workspace_id type: string description: ID or slug of the workspace required: true - name: current_page type: integer description: Page number for pagination (0-indexed) - name: page_size type: integer description: Number of items per page - name: search type: string description: Search query to filter collections by name outputParameters: - type: object mapping: $. - name: get-collections-collectionid description: Get collection details hints: readOnly: true destructive: false idempotent: true call: portkey.get-collections-collectionid outputParameters: - type: object mapping: $. - name: put-collections-collectionid description: Update collection hints: readOnly: false destructive: false idempotent: true call: portkey.put-collections-collectionid outputParameters: - type: object mapping: $. - name: delete-collections-collectionid description: Delete collection hints: readOnly: false destructive: true idempotent: true call: portkey.delete-collections-collectionid outputParameters: - type: object mapping: $. - name: createlabel description: Create a new label hints: readOnly: false destructive: false idempotent: false call: portkey.createlabel outputParameters: - type: object mapping: $. - name: listlabels description: List labels hints: readOnly: true destructive: false idempotent: true call: portkey.listlabels with: organisation_id: tools.organisation_id workspace_id: tools.workspace_id search: tools.search current_page: tools.current_page page_size: tools.page_size inputParameters: - name: organisation_id type: string description: ID of the organisation - name: workspace_id type: string description: ID or slug of the workspace - name: search type: string description: Search query to filter labels by name - name: current_page type: integer description: Page number for pagination - name: page_size type: integer description: Number of items per page outputParameters: - type: object mapping: $. - name: getlabel description: Get a label by ID hints: readOnly: true destructive: false idempotent: true call: portkey.getlabel with: labelId: tools.labelId organisation_id: tools.organisation_id workspace_id: tools.workspace_id inputParameters: - name: labelId type: string description: ID of the label to retrieve required: true - name: organisation_id type: string description: ID of the organisation - name: workspace_id type: string description: ID or slug of the workspace outputParameters: - type: object mapping: $. - name: updatelabel description: Update a label hints: readOnly: false destructive: false idempotent: true call: portkey.updatelabel with: labelId: tools.labelId inputParameters: - name: labelId type: string description: ID of the label to update required: true outputParameters: - type: object mapping: $. - name: deletelabel description: Delete a label hints: readOnly: false destructive: true idempotent: true call: portkey.deletelabel with: labelId: tools.labelId inputParameters: - name: labelId type: string description: ID of the label to delete required: true outputParameters: - type: object mapping: $. - name: createprompt description: Create a new prompt hints: readOnly: false destructive: false idempotent: false call: portkey.createprompt outputParameters: - type: object mapping: $. - name: listprompts description: List prompts hints: readOnly: true destructive: false idempotent: true call: portkey.listprompts with: collection_id: tools.collection_id workspace_id: tools.workspace_id current_page: tools.current_page page_size: tools.page_size search: tools.search inputParameters: - name: collection_id type: string description: collection_id - name: workspace_id type: string description: workspace_id - name: current_page type: integer description: current_page - name: page_size type: integer description: page_size - name: search type: string description: search outputParameters: - type: object mapping: $. - name: getprompt description: Get a prompt by ID or slug hints: readOnly: true destructive: false idempotent: true call: portkey.getprompt with: promptId: tools.promptId inputParameters: - name: promptId type: string description: promptId required: true outputParameters: - type: object mapping: $. - name: updateprompt description: Update a prompt hints: readOnly: false destructive: false idempotent: true call: portkey.updateprompt with: promptId: tools.promptId inputParameters: - name: promptId type: string description: promptId required: true outputParameters: - type: object mapping: $. - name: deleteprompt description: Delete a prompt hints: readOnly: false destructive: true idempotent: true call: portkey.deleteprompt with: promptId: tools.promptId inputParameters: - name: promptId type: string description: promptId required: true outputParameters: - type: object mapping: $. - name: getpromptversions description: Get all versions of a prompt hints: readOnly: true destructive: false idempotent: true call: portkey.getpromptversions with: promptId: tools.promptId inputParameters: - name: promptId type: string description: promptId required: true outputParameters: - type: object mapping: $. - name: getpromptbyversion description: Get a specific version of a prompt hints: readOnly: true destructive: false idempotent: true call: portkey.getpromptbyversion with: promptId: tools.promptId versionId: tools.versionId inputParameters: - name: promptId type: string description: promptId required: true - name: versionId type: string description: versionId required: true outputParameters: - type: object mapping: $. - name: updatepromptversion description: Update a specific version of a prompt hints: readOnly: false destructive: false idempotent: true call: portkey.updatepromptversion with: promptId: tools.promptId versionId: tools.versionId inputParameters: - name: promptId type: string description: promptId required: true - name: versionId type: string description: versionId required: true outputParameters: - type: object mapping: $. - name: updatepromptdefault description: Set a version as the default for a prompt hints: readOnly: false destructive: false idempotent: true call: portkey.updatepromptdefault with: promptId: tools.promptId inputParameters: - name: promptId type: string description: promptId required: true outputParameters: - type: object mapping: $. - name: createpromptpartial description: Create a new prompt partial hints: readOnly: false destructive: false idempotent: false call: portkey.createpromptpartial outputParameters: - type: object mapping: $. - name: listpromptpartials description: List prompt partials hints: readOnly: true destructive: false idempotent: true call: portkey.listpromptpartials with: collection_id: tools.collection_id inputParameters: - name: collection_id type: string description: collection_id outputParameters: - type: object mapping: $. - name: getpromptpartial description: Get a prompt partial by ID or slug hints: readOnly: true destructive: false idempotent: true call: portkey.getpromptpartial with: promptPartialId: tools.promptPartialId inputParameters: - name: promptPartialId type: string description: promptPartialId required: true outputParameters: - type: object mapping: $. - name: updatepromptpartial description: Update a prompt partial hints: readOnly: false destructive: false idempotent: true call: portkey.updatepromptpartial with: promptPartialId: tools.promptPartialId inputParameters: - name: promptPartialId type: string description: promptPartialId required: true outputParameters: - type: object mapping: $. - name: deletepromptpartial description: Delete a prompt partial hints: readOnly: false destructive: true idempotent: true call: portkey.deletepromptpartial with: promptPartialId: tools.promptPartialId inputParameters: - name: promptPartialId type: string description: promptPartialId required: true outputParameters: - type: object mapping: $. - name: getpromptpartialversions description: Get all versions of a prompt partial hints: readOnly: true destructive: false idempotent: true call: portkey.getpromptpartialversions with: promptPartialId: tools.promptPartialId inputParameters: - name: promptPartialId type: string description: promptPartialId required: true outputParameters: - type: object mapping: $. - name: updatepromptpartialdefault description: Set a version as the default for a prompt partial hints: readOnly: false destructive: false idempotent: true call: portkey.updatepromptpartialdefault with: promptPartialId: tools.promptPartialId inputParameters: - name: promptPartialId type: string description: promptPartialId required: true outputParameters: - type: object mapping: $. - name: createpromptcompletion description: Prompts Completions hints: readOnly: false destructive: false idempotent: false call: portkey.createpromptcompletion with: promptId: tools.promptId inputParameters: - name: promptId type: string description: The unique identifier of the prompt template to use required: true outputParameters: - type: object mapping: $. - name: createpromptrender description: Prompts Render hints: readOnly: false destructive: false idempotent: false call: portkey.createpromptrender with: promptId: tools.promptId inputParameters: - name: promptId type: string description: The unique identifier of the prompt template to render required: true outputParameters: - type: object mapping: $. - name: createguardrail description: Create a new guardrail hints: readOnly: false destructive: false idempotent: false call: portkey.createguardrail outputParameters: - type: object mapping: $. - name: listguardrails description: List guardrails hints: readOnly: true destructive: false idempotent: true call: portkey.listguardrails with: workspace_id: tools.workspace_id organisation_id: tools.organisation_id page_size: tools.page_size current_page: tools.current_page inputParameters: - name: workspace_id type: string description: Workspace UUID to filter guardrails - name: organisation_id type: string description: Organisation UUID to filter guardrails - name: page_size type: integer description: Number of items per page - name: current_page type: integer description: Current page number (0-indexed) outputParameters: - type: object mapping: $. - name: getguardrail description: Get a specific guardrail hints: readOnly: true destructive: false idempotent: true call: portkey.getguardrail with: guardrailId: tools.guardrailId inputParameters: - name: guardrailId type: string description: Guardrail UUID or slug (with guard_ prefix) required: true outputParameters: - type: object mapping: $. - name: updateguardrail description: Update a guardrail hints: readOnly: false destructive: false idempotent: true call: portkey.updateguardrail with: guardrailId: tools.guardrailId inputParameters: - name: guardrailId type: string description: Guardrail UUID or slug to update required: true outputParameters: - type: object mapping: $. - name: deleteguardrail description: Delete a guardrail hints: readOnly: false destructive: true idempotent: true call: portkey.deleteguardrail with: guardrailId: tools.guardrailId inputParameters: - name: guardrailId type: string description: Guardrail UUID or slug to delete required: true outputParameters: - type: object mapping: $. - name: createimage description: Create Image hints: readOnly: false destructive: false idempotent: false call: portkey.createimage outputParameters: - type: object mapping: $. - name: createimageedit description: Create Image Edit hints: readOnly: false destructive: false idempotent: false call: portkey.createimageedit outputParameters: - type: object mapping: $. - name: createimagevariation description: Creates Image Variation hints: readOnly: false destructive: false idempotent: false call: portkey.createimagevariation outputParameters: - type: object mapping: $. - name: createembedding description: Embeddings hints: readOnly: false destructive: false idempotent: false call: portkey.createembedding outputParameters: - type: object mapping: $. - name: creatererank description: Rerank hints: readOnly: false destructive: false idempotent: false call: portkey.creatererank outputParameters: - type: object mapping: $. - name: createspeech description: Create Speech hints: readOnly: false destructive: false idempotent: false call: portkey.createspeech outputParameters: - type: object mapping: $. - name: createtranscription description: Create Transcription hints: readOnly: false destructive: false idempotent: false call: portkey.createtranscription outputParameters: - type: object mapping: $. - name: createtranslation description: Create Translation hints: readOnly: false destructive: false idempotent: false call: portkey.createtranslation outputParameters: - type: object mapping: $. - name: listfiles description: List Files hints: readOnly: true destructive: false idempotent: true call: portkey.listfiles with: purpose: tools.purpose inputParameters: - name: purpose type: string description: Only return files with the given purpose. outputParameters: - type: object mapping: $. - name: createfile 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. hints: readOnly: false destructive: false idempotent: false call: portkey.createfile outputParameters: - type: object mapping: $. - name: deletefile description: Delete File hints: readOnly: false destructive: true idempotent: true call: portkey.deletefile with: file_id: tools.file_id inputParameters: - name: file_id type: string description: The ID of the file to use for this request. required: true outputParameters: - type: object mapping: $. - name: retrievefile description: Returns information about a specific file. hints: readOnly: true destructive: false idempotent: true call: portkey.retrievefile with: file_id: tools.file_id inputParameters: - name: file_id type: string description: The ID of the file to use for this request. required: true outputParameters: - type: object mapping: $. - name: downloadfile description: Returns the contents of the specified file. hints: readOnly: true destructive: false idempotent: true call: portkey.downloadfile with: file_id: tools.file_id inputParameters: - name: file_id type: string description: The ID of the file to use for this request. required: true outputParameters: - type: object mapping: $. - name: createfinetuningjob description: Create a Finetune Job hints: readOnly: false destructive: false idempotent: false call: portkey.createfinetuningjob outputParameters: - type: object mapping: $. - name: listpaginatedfinetuningjobs description: List your organization's fine-tuning jobs hints: readOnly: true destructive: false idempotent: true call: portkey.listpaginatedfinetuningjobs with: after: tools.after limit: tools.limit inputParameters: - name: after type: string description: Identifier for the last job from the previous pagination request. - name: limit type: integer description: Number of fine-tuning jobs to retrieve. outputParameters: - type: object mapping: $. - name: retrievefinetuningjob description: Get info about a fine-tuning job. [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning) hints: readOnly: true destructive: false idempotent: true call: portkey.retrievefinetuningjob with: fine_tuning_job_id: tools.fine_tuning_job_id inputParameters: - name: fine_tuning_job_id type: string description: The ID of the fine-tuning job. required: true outputParameters: - type: object mapping: $. - name: listfinetuningevents description: Get status updates for a fine-tuning job. hints: readOnly: true destructive: false idempotent: true call: portkey.listfinetuningevents with: fine_tuning_job_id: tools.fine_tuning_job_id after: tools.after limit: tools.limit inputParameters: - name: fine_tuning_job_id type: string description: The ID of the fine-tuning job to get events for. required: true - name: after type: string description: Identifier for the last event from the previous pagination request. - name: limit type: integer description: Number of events to retrieve. outputParameters: - type: object mapping: $. - name: cancelfinetuningjob description: Immediately cancel a fine-tune job. hints: readOnly: false destructive: false idempotent: false call: portkey.cancelfinetuningjob with: fine_tuning_job_id: tools.fine_tuning_job_id inputParameters: - name: fine_tuning_job_id type: string description: The ID of the fine-tuning job to cancel. required: true outputParameters: - type: object mapping: $. - name: listfinetuningjobcheckpoints description: List checkpoints for a fine-tuning job. hints: readOnly: true destructive: false idempotent: true call: portkey.listfinetuningjobcheckpoints with: fine_tuning_job_id: tools.fine_tuning_job_id after: tools.after limit: tools.limit inputParameters: - name: fine_tuning_job_id type: string description: The ID of the fine-tuning job to get checkpoints for. required: true - name: after type: string description: Identifier for the last checkpoint ID from the previous pagination request. - name: limit type: integer description: Number of checkpoints to retrieve. outputParameters: - type: object mapping: $. - name: listmodels description: List Available Models hints: readOnly: true destructive: false idempotent: true call: portkey.listmodels with: ai_service: tools.ai_service provider: tools.provider limit: tools.limit offset: tools.offset sort: tools.sort order: tools.order inputParameters: - name: ai_service type: string description: Filter models by the AI service (e.g., 'openai', 'anthropic'). - name: provider type: string description: Filter models by the provider. - name: limit type: integer description: The maximum number of models to return. - name: offset type: integer description: The number of models to skip before starting to collect the result set. - name: sort type: string description: The field to sort the results by. - name: order type: string description: The order to sort the results in. outputParameters: - type: object mapping: $. - name: retrievemodel description: Retrieves a model instance, providing basic information about the model such as the owner and permissioning. hints: readOnly: true destructive: false idempotent: true call: portkey.retrievemodel with: model: tools.model inputParameters: - name: model type: string description: The ID of the model to use for this request required: true outputParameters: - type: object mapping: $. - name: deletemodel description: Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. hints: readOnly: false destructive: true idempotent: true call: portkey.deletemodel with: model: tools.model inputParameters: - name: model type: string description: The model to delete required: true outputParameters: - type: object mapping: $. - name: createmoderation description: Identify potentially harmful content in text and images. **Only** works with [OpenAI's Moderations endpoint](https://platform.openai.com/docs/guides/moderation) currently. hints: readOnly: false destructive: false idempotent: false call: portkey.createmoderation outputParameters: - type: object mapping: $. - name: listassistants description: Returns a list of assistants. hints: readOnly: true destructive: false idempotent: true call: portkey.listassistants with: limit: tools.limit order: tools.order after: tools.after before: tools.before inputParameters: - name: limit 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 type: string description: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - name: after 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 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, ' outputParameters: - type: object mapping: $. binds: - namespace: env keys: PORTKEY_TOKEN: PORTKEY_TOKEN