openapi: 3.0.0 info: title: Portkey Analytics > Graphs Guardrails API description: The Portkey REST API. Please see https://portkey.ai/docs/api-reference for more details. version: 2.0.0 termsOfService: https://portkey.ai/terms contact: name: Portkey Developer Forum url: https://portkey.wiki/community license: name: MIT url: https://github.com/Portkey-AI/portkey-openapi/blob/master/LICENSE servers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint security: - Portkey-Key: [] tags: - name: Guardrails description: Create, List, Retrieve, Update, and Delete prompt Guardrails. paths: /guardrails: post: summary: Create a new guardrail description: Creates a new guardrail with specified checks and actions operationId: createGuardrail tags: - Guardrails requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateGuardrailRequest' examples: jwt_authentication: summary: '[BASIC] JWT Token Validation' value: name: JWT Authentication Guard organisation_id: 550e8400-e29b-41d4-a716-446655440001 checks: - id: default.jwt parameters: jwksUri: https://example.com/.well-known/jwks.json headerKey: Authorization algorithms: - RS256 cacheMaxAge: 86400 clockTolerance: 5 maxTokenAge: 1d actions: onFail: block message: Invalid JWT token model_whitelist: summary: '[BASIC] Model Whitelist Control' value: name: Allowed Models Only workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.modelWhitelist parameters: models: - gpt-4 - gpt-3.5-turbo - claude-3-sonnet - claude-3-haiku actions: onFail: block message: Model not in approved whitelist allowed_request_types: summary: '[BASIC] Restrict to Chat and Embed Only' value: name: Restrict to Chat and Embed Only checks: - id: default.allowedRequestTypes parameters: allowedTypes: - chatComplete - embed actions: on_fail: deny on_success: continue case_validation: summary: '[BASIC] Case Validation Checks' value: name: Text Case Validation workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.isAllLowerCase - id: default.alluppercase parameters: not: true actions: onFail: log message: Text case validation failed content_regex: summary: '[BASIC] Regex Pattern Matching' value: name: Content Pattern Validation workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.regexMatch parameters: rule: \b(inappropriate|banned|harmful|offensive)\b not: false - id: default.endsWith parameters: suffix: . not: false actions: onFail: block message: Content violates pattern rules length_controls: summary: '[BASIC] Content Length Controls' value: name: Content Length Validation workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.wordCount parameters: minWords: 5 maxWords: 500 not: false - id: default.sentenceCount parameters: minSentences: 1 maxSentences: 20 not: false - id: default.characterCount parameters: minCharacters: 10 maxCharacters: 4000 not: false actions: onFail: block message: Content length out of bounds json_validation: summary: '[BASIC] JSON Structure Validation' value: name: JSON Response Validation workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.jsonSchema parameters: schema: type: object properties: result: type: string confidence: type: number minimum: 0 maximum: 1 metadata: type: object required: - result not: false - id: default.jsonKeys parameters: keys: - result - timestamp - id operator: all actions: onFail: block message: Response does not match expected format content_analysis: summary: '[BASIC] Content Analysis Checks' value: name: Content Quality Checks workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.contains parameters: words: - please - thank you - help operator: any - id: default.validUrls parameters: onlyDNS: true not: false - id: default.containsCode parameters: format: SQL not: true actions: onFail: warn message: Content quality check failed webhook_integration: summary: '[BASIC] Custom Webhook Validation' value: name: External Validation Service workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.webhook parameters: webhookURL: https://api.example.com/validate-content headers: Authorization: Bearer token123 Content-Type: application/json X-API-Version: v1 timeout: 5000 failOnError: true actions: onFail: block message: External validation failed metadata_validation: summary: '[BASIC] Required Metadata Keys' value: name: Metadata Requirement Check workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: default.requiredMetadataKeys parameters: metadataKeys: - user_id - session_id - request_type operator: all actions: onFail: block message: Required metadata missing portkey_moderation: summary: '[PRO] OpenAI Content Moderation' value: name: Advanced Content Moderation workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: portkey.moderateContent parameters: categories: - hate/threatening - harassment/threatening - self-harm/intent - sexual/minors - violence/graphic timeout: 5000 actions: onFail: block message: Content flagged by moderation system portkey_language: summary: '[PRO] Language Detection & Validation' value: name: Multi-Language Support workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: portkey.language parameters: language: eng_Latn not: false timeout: 5000 actions: onFail: block message: Content not in expected language portkey_pii: summary: '[PRO] Advanced PII Detection' value: name: PII Protection System workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: portkey.pii parameters: redact: true categories: - EMAIL_ADDRESS - PHONE_NUMBER - SSN - CREDIT_CARD - NAME timeout: 5000 actions: onFail: block message: PII detected and redacted portkey_gibberish: summary: '[PRO] Gibberish Detection' value: name: Content Quality Filter workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: portkey.gibberish parameters: timeout: 5000 actions: onFail: block message: Content appears to be gibberish sydelabs_security: summary: '[PARTNER] SydeLabs AI Security' value: name: AI Security Suite workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: sydelabs.sydeguard parameters: prompt_injection_threshold: 0.5 toxicity_threshold: 0.3 evasion_threshold: 0.6 timeout: 5000 actions: onFail: block message: AI security check failed aporia_validation: summary: '[PARTNER] Aporia Project Validation' value: name: Aporia Policy Enforcement workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: aporia.validateProject parameters: projectID: proj_abc123 timeout: 5000 actions: onFail: block message: Aporia validation failed pillar_scanning: summary: '[PARTNER] Pillar Security Scanning' value: name: Comprehensive Security Scan workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: pillar.scanPrompt parameters: scanners: - prompt_injection - pii - secrets - toxic_language - invisible_characters timeout: 5000 - id: pillar.scanResponse parameters: scanners: - pii - secrets - toxic_language timeout: 5000 actions: onFail: block message: Security scan detected issues patronus_comprehensive: summary: '[PARTNER] Patronus AI Complete Suite' value: name: Patronus Content Analysis workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: patronus.pii parameters: redact: true timeout: 5000 - id: patronus.toxicity parameters: timeout: 5000 - id: patronus.noGenderBias parameters: timeout: 15000 - id: patronus.isHelpful parameters: timeout: 15000 - id: patronus.custom parameters: profile: system:is-concise timeout: 15000 actions: onFail: block message: Content failed Patronus analysis azure_content_safety: summary: '[PARTNER] Azure Content Safety Suite' value: name: Microsoft Azure Safety workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: azure.contentSafety parameters: blocklistNames: - company_blocklist apiVersion: '2024-09-01' severity: 2 categories: - Hate - SelfHarm - Sexual - Violence timeout: 5000 - id: azure.pii parameters: domain: phi apiVersion: '2024-11-01' modelVersion: latest redact: true timeout: 5000 actions: onFail: block message: Azure safety checks failed mistral_moderation: summary: '[PARTNER] Mistral Content Moderation' value: name: Mistral AI Moderation workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: mistral.moderateContent parameters: categories: - sexual - hate_and_discrimination - violence_and_threats - selfharm - pii timeout: 5000 actions: onFail: block message: Mistral moderation flagged content bedrock_enterprise: summary: '[PARTNER] AWS Bedrock Guardrails' value: name: Enterprise AWS Security workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: bedrock.guard parameters: guardrailVersion: DRAFT guardrailId: gdrail123abc redact: true timeout: 5000 actions: onFail: block message: AWS Bedrock guardrail violation promptfoo_testing: summary: '[PARTNER] Promptfoo Security Testing' value: name: Security Testing Suite workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: promptfoo.guard parameters: timeout: 5000 - id: promptfoo.pii parameters: redact: true timeout: 5000 - id: promptfoo.harm parameters: timeout: 5000 actions: onFail: block message: Promptfoo security tests failed acuvity_comprehensive: summary: '[PARTNER] Acuvity Multi-Vector Security' value: name: Complete Security Analysis workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: acuvity.scan parameters: prompt_injection: true prompt_injection_threshold: 0.5 toxic: true toxic_threshold: 0.3 jail_break: true jail_break_threshold: 0.6 malicious_url: true biased: true harmful: true language: true language_values: english pii: true pii_redact: true pii_categories: - email_address - ssn - credit_card secrets: true secrets_redact: true secrets_categories: - aws_secret_key - openai - github timeout: 5000 actions: onFail: block message: Comprehensive security scan failed lasso_classification: summary: '[PARTNER] Lasso Security Classification' value: name: Content Classification workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: lasso.classify parameters: timeout: 5000 actions: onFail: block message: Lasso classification failed panw_prisma: summary: '[PARTNER] PANW Prisma AIRS Enterprise' value: name: Enterprise Security Runtime workspace_id: 550e8400-e29b-41d4-a716-446655440000 checks: - id: panw-prisma-airs.intercept parameters: profile_name: enterprise_profile ai_model: gpt-4 app_user: api_user_123 actions: onFail: block message: Prisma AIRS blocked request responses: '200': description: Guardrail created successfully content: application/json: schema: $ref: '#/components/schemas/CreateGuardrailResponse' '400': description: Bad request - validation failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden - insufficient permissions or guardrail not allowed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' get: summary: List guardrails description: Retrieves a paginated list of guardrails for the specified workspace or organisation operationId: listGuardrails tags: - Guardrails parameters: - name: workspace_id in: query description: Workspace UUID to filter guardrails schema: type: string format: uuid - name: organisation_id in: query description: Organisation UUID to filter guardrails schema: type: string format: uuid - name: page_size in: query description: Number of items per page schema: type: integer minimum: 1 maximum: 1000 default: 100 - name: current_page in: query description: Current page number (0-indexed) schema: type: integer minimum: 0 default: 0 responses: '200': description: List of guardrails retrieved successfully content: application/json: schema: $ref: '#/components/schemas/ListGuardrailsResponse' '400': description: Bad request - invalid parameters content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden - insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /guardrails/{guardrailId}: get: summary: Get a specific guardrail description: Retrieves details of a specific guardrail by ID or slug operationId: getGuardrail tags: - Guardrails parameters: - name: guardrailId in: path required: true description: Guardrail UUID or slug (with guard_ prefix) schema: type: string examples: uuid: summary: Using UUID value: 550e8400-e29b-41d4-a716-446655440000 slug: summary: Using slug value: guard_abc123 responses: '200': description: Guardrail details retrieved successfully content: application/json: schema: $ref: '#/components/schemas/GuardrailDetails' '403': description: Forbidden - guardrail not found or insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' put: summary: Update a guardrail description: Updates an existing guardrail's name, checks, or actions operationId: updateGuardrail tags: - Guardrails parameters: - name: guardrailId in: path required: true description: Guardrail UUID or slug to update schema: type: string requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateGuardrailRequest' responses: '200': description: Guardrail updated successfully content: application/json: schema: $ref: '#/components/schemas/UpdateGuardrailResponse' '400': description: Bad request - validation failed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden - guardrail not found or insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' delete: summary: Delete a guardrail description: Deletes an existing guardrail operationId: deleteGuardrail tags: - Guardrails parameters: - name: guardrailId in: path required: true description: Guardrail UUID or slug to delete schema: type: string responses: '200': description: Guardrail deleted successfully '403': description: Forbidden - guardrail not found or insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: PatronusParameters: title: Patronus Parameters type: object properties: redact: type: boolean description: Whether to redact detected content default: false timeout: type: number description: Timeout in milliseconds default: 5000 AcuvityScanParameters: title: Acuvity Scan Parameters type: object properties: prompt_injection: type: boolean description: Enable prompt injection detection default: true prompt_injection_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for prompt injection detection default: 0.5 toxic: type: boolean description: Enable toxicity detection default: true toxic_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for toxicity detection default: 0.5 jail_break: type: boolean description: Enable jailbreak detection default: true jail_break_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for jailbreak detection default: 0.5 malicious_url: type: boolean description: Enable malicious URL detection default: true malicious_url_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for malicious URL detection default: 0.5 biased: type: boolean description: Enable bias detection default: true biased_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for bias detection default: 0.5 harmful: type: boolean description: Enable harmful content detection default: true harmful_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for harmful content detection default: 0.5 language: type: boolean description: Enable language check default: true language_values: type: string enum: - english - chinese - spanish - french - german - japanese - gibberish description: Language to check default: english pii: type: boolean description: Enable PII detection default: true pii_redact: type: boolean description: Enable PII redaction default: false pii_categories: type: array items: type: string enum: - email_address - ssn - person - aba_routing_number - address - bank_account - bitcoin_wallet - credit_card - driver_license - itin_number - location - medical_license - money_amount - passport_number - phone_number description: PII categories to detect secrets: type: boolean description: Enable secrets detection default: true secrets_redact: type: boolean description: Enable secrets redaction default: false secrets_categories: type: array items: type: string enum: - credentials - aws_secret_key - github - openai - stripe - jwt - private_key description: Secret categories to detect timeout: type: number description: Timeout in milliseconds default: 5000 WordCountParameters: title: Word Count Parameters type: object properties: minWords: type: number description: Minimum number of words to allow default: 0 maxWords: type: number description: Maximum number of words to allow default: 99999 not: type: boolean description: If true, the verdict will be inverted default: false GuardrailActions: type: object description: Actions to take when guardrail checks fail or pass properties: deny: type: boolean description: Whether to deny the request when guardrail check fails default: false async: type: boolean description: Whether the guardrail check should be performed asynchronously default: false on_success: type: object description: Actions to take when guardrail check passes properties: feedback: type: object description: Feedback configuration for successful checks properties: value: type: number description: Feedback value for successful checks default: 5 weight: type: number description: Weight of the feedback default: 1 metadata: type: string description: Additional metadata for the feedback default: '' required: - value - weight - metadata required: - feedback on_fail: type: object description: Actions to take when guardrail check fails properties: feedback: type: object description: Feedback configuration for failed checks properties: value: type: number description: Feedback value for failed checks default: -5 weight: type: number description: Weight of the feedback default: 1 metadata: type: string description: Additional metadata for the feedback default: '' required: - value - weight - metadata required: - feedback required: - deny - async - on_success - on_fail AllowedRequestTypesParameters: title: Allowed Request Types Parameters type: object description: Parameters for default.allowedRequestTypes check. Restrict which request types are allowed or blocked. You can use either or both; when both are specified, blocked types take precedence. properties: allowedTypes: type: array items: type: string enum: - complete - chatComplete - embed - rerank - moderate - proxy - imageGenerate - createSpeech - createTranscription - createTranslation - realtime - uploadFile - listFiles - retrieveFile - deleteFile - retrieveFileContent - createBatch - retrieveBatch - cancelBatch - listBatches - getBatchOutput - listFinetunes - createFinetune - retrieveFinetune - cancelFinetune - createModelResponse - getModelResponse - deleteModelResponse - listResponseInputItems - messages description: Request types to allow (allowlist). When set, only these request types are permitted. blockedTypes: type: array items: type: string enum: - complete - chatComplete - embed - rerank - moderate - proxy - imageGenerate - createSpeech - createTranscription - createTranslation - realtime - uploadFile - listFiles - retrieveFile - deleteFile - retrieveFileContent - createBatch - retrieveBatch - cancelBatch - listBatches - getBatchOutput - listFinetunes - createFinetune - retrieveFinetune - cancelFinetune - createModelResponse - getModelResponse - deleteModelResponse - listResponseInputItems - messages description: Request types to block (blocklist). When set, these request types are denied. CreateGuardrailRequest: type: object required: - name - checks - actions properties: name: type: string description: Name of the guardrail example: Content Safety Check workspace_id: type: string format: uuid description: Workspace UUID (required if organisation_id not provided and not using API key) organisation_id: type: string format: uuid description: Organisation UUID (required if workspace_id not provided and not using API key) checks: type: array description: Array of guardrail checks to apply items: $ref: '#/components/schemas/GuardrailCheck' minItems: 1 actions: $ref: '#/components/schemas/GuardrailActions' WebhookParameters: title: Webhook Parameters type: object required: - webhookURL properties: webhookURL: type: string format: uri description: Webhook URL to call headers: type: object additionalProperties: true description: Headers to send with the request timeout: type: number description: Timeout in milliseconds default: 3000 failOnError: type: boolean description: Fail if webhook returns non-200 status or times out default: false Error: type: object properties: code: type: string nullable: true message: type: string nullable: false param: type: string nullable: true type: type: string nullable: false required: - type - message - param - code BasicParameters: title: Basic Parameters type: object description: Basic parameters with no specific requirements additionalProperties: true EndsWithParameters: title: Ends With Parameters type: object required: - suffix properties: suffix: type: string description: Suffix to check for not: type: boolean description: If true, the verdict will be inverted default: false JWTParameters: title: JWT Parameters type: object required: - jwksUri - headerKey properties: jwksUri: type: string format: uri description: JWKS URI of the JWT token headerKey: type: string description: Header key to check for the JWT token cacheMaxAge: type: number description: Cache max age in seconds default: 86400 clockTolerance: type: number description: Clock tolerance in seconds default: 5 maxTokenAge: type: string description: Max token age default: 1d algorithms: type: array items: type: string description: Algorithms to check for the JWT token default: - RS256 ListGuardrailsResponse: type: object required: - data - total properties: data: type: array description: Array of guardrail summaries items: $ref: '#/components/schemas/GuardrailSummary' total: type: integer description: Total number of guardrails available minimum: 0 PatronusCustomParameters: title: Patronus Custom Parameters type: object required: - profile properties: profile: type: string description: Custom evaluator profile name (e.g., system:is-concise) timeout: type: number description: Timeout in milliseconds default: 15000 JSONKeysParameters: title: JSON Keys Parameters type: object required: - keys - operator properties: keys: type: array items: type: string description: Keys to check for in JSON operator: type: string enum: - any - all - none description: Operator to use for key checking default: any ErrorResponse: type: object properties: error: $ref: '#/components/schemas/Error' required: - error SentenceCountParameters: title: Sentence Count Parameters type: object properties: minSentences: type: number description: Minimum number of sentences to allow default: 0 maxSentences: type: number description: Maximum number of sentences to allow default: 99999 not: type: boolean description: If true, the verdict will be inverted default: false UpdateGuardrailResponse: type: object required: - id - slug properties: id: type: string description: Unique identifier of the updated guardrail slug: type: string description: URL-friendly slug for the guardrail version_id: type: string description: New version identifier after update RequiredMetadataKeysParameters: title: Required Metadata Keys Parameters type: object required: - metadataKeys - operator properties: metadataKeys: type: array items: type: string description: Metadata keys to check for operator: type: string enum: - all - any - none description: Operator to use for key checking default: all ModelWhitelistParameters: title: Model Whitelist Parameters type: object required: - models properties: models: type: array items: type: string description: List of allowed models AzureContentSafetyParameters: title: Azure Content Safety Parameters type: object properties: blocklistNames: type: array items: type: string description: Array of blocklist names to check against default: [] apiVersion: type: string description: API version for the Content Safety API default: '2024-09-01' severity: type: number description: Severity threshold for the Content Safety API default: 2 categories: type: array items: type: string enum: - Hate - SelfHarm - Sexual - Violence description: Categories to check against timeout: type: number description: Timeout in milliseconds default: 5000 PromptfooParameters: title: Promptfoo Parameters type: object properties: redact: type: boolean description: Whether to redact detected content default: false timeout: type: number description: Timeout in milliseconds default: 5000 GuardrailSummary: type: object required: - id - name - slug - created_at - last_updated_at - owner_id properties: id: type: string description: Unique identifier of the guardrail name: type: string description: Name of the guardrail slug: type: string description: URL-friendly slug organisation_id: type: string format: uuid description: Organisation UUID workspace_id: type: string format: uuid nullable: true description: Workspace UUID (null for organisation-level guardrails) status: type: string enum: - active - archived description: Current status of the guardrail created_at: type: string format: date-time description: Creation timestamp last_updated_at: type: string format: date-time description: Last update timestamp owner_id: type: string format: uuid description: UUID of the user who created the guardrail updated_by: type: string format: uuid nullable: true description: UUID of the user who last updated the guardrail AporiaParameters: title: Aporia Parameters type: object required: - projectID properties: projectID: type: string description: Aporia Project ID to validate timeout: type: number description: Timeout in milliseconds default: 5000 ValidUrlsParameters: title: Valid URLs Parameters type: object properties: onlyDNS: type: boolean description: Only check if URL domains resolve (10x faster) default: false not: type: boolean description: If true, the verdict will be inverted default: false UppercaseParameters: title: Uppercase Parameters type: object properties: not: type: boolean description: If true, the verdict will be inverted default: false MistralModerationParameters: title: Mistral Moderation Parameters type: object required: - categories properties: categories: type: array items: type: string enum: - sexual - hate_and_discrimination - violence_and_threats - dangerous_and_criminal_content - selfharm - health - financial - law - pii description: Categories that should NOT be allowed timeout: type: number description: Timeout in milliseconds default: 5000 BedrockGuardParameters: title: Bedrock Guard Parameters type: object required: - guardrailVersion - guardrailId properties: guardrailVersion: type: string description: Version of the guardrail to use guardrailId: type: string description: ID of the guardrail redact: type: boolean description: Whether to redact detected PII default: false timeout: type: number description: Timeout in milliseconds default: 5000 PortkeyLanguageParameters: title: Portkey Language Parameters type: object properties: language: type: string enum: - eng_Latn - zho_Hans - spa_Latn - ara_Arab - por_Latn - ind_Latn - fra_Latn - jpn_Jpan - rus_Cyrl - deu_Latn - kor_Hang - tur_Latn - ita_Latn - pes_Arab - pol_Latn - vie_Latn - nld_Latn - hin_Deva - tha_Thai - heb_Hebr - ben_Beng - swe_Latn - ces_Latn - ron_Latn - ell_Grek - ukr_Cyrl - dan_Latn - fin_Latn - nor_Latn - hun_Latn - cat_Latn - bul_Cyrl - msa_Latn - hrv_Latn - arb_Latn - slk_Latn - lit_Latn - lav_Latn - srp_Cyrl - slv_Latn - est_Latn - urd_Arab - fil_Latn - aze_Latn - tam_Taml - tel_Telu - mar_Deva - kan_Knda - fas_Arab description: Language that should be allowed in content not: type: boolean description: If true, the verdict will be inverted default: false timeout: type: number description: Timeout in milliseconds default: 5000 CharacterCountParameters: title: Character Count Parameters type: object properties: minCharacters: type: number description: Minimum number of characters to allow default: 0 maxCharacters: type: number description: Maximum number of characters to allow default: 9999999 not: type: boolean description: If true, the verdict will be inverted default: false UpdateGuardrailRequest: type: object properties: name: type: string description: Updated name of the guardrail checks: type: array description: Updated array of guardrail checks items: $ref: '#/components/schemas/GuardrailCheck' minItems: 1 actions: $ref: '#/components/schemas/GuardrailActions' PortkeyPIIParameters: title: Portkey PII Parameters type: object required: - categories properties: redact: type: boolean description: Whether to redact detected PII default: false categories: type: array items: type: string enum: - EMAIL_ADDRESS - PHONE_NUMBER - LOCATION_ADDRESS - NAME - IP_ADDRESS - CREDIT_CARD - SSN description: Types of PII that should NOT be allowed timeout: type: number description: Timeout in milliseconds default: 5000 GuardrailDetails: allOf: - $ref: '#/components/schemas/GuardrailSummary' - type: object properties: checks: type: array description: Array of configured guardrail checks items: $ref: '#/components/schemas/GuardrailCheck' actions: $ref: '#/components/schemas/GuardrailActions' PANWPrismaParameters: title: PANW Prisma Parameters type: object required: - profile_name properties: profile_name: type: string description: Prisma profile name ai_model: type: string description: AI model identifier app_user: type: string description: Application user identifier ContainsCodeParameters: title: Contains Code Parameters type: object required: - format properties: format: type: string enum: - SQL - Python - TypeScript - JavaScript - Java - C# - C++ - C - Ruby - PHP - Swift - Kotlin - Go - Rust - Scala - R - Perl - Shell - HTML - CSS - XML - JSON - YAML - Markdown - Dockerfile description: Code format to check for not: type: boolean description: If true, the verdict will be inverted default: false ContainsParameters: title: Contains Parameters type: object required: - words - operator properties: words: type: array items: type: string description: Words or phrases to check for operator: type: string enum: - any - all - none description: Operator to use for word checking default: any JSONSchemaParameters: title: JSON Schema Parameters type: object required: - schema properties: schema: type: object additionalProperties: true description: JSON schema to validate against not: type: boolean description: If true, the verdict will be inverted default: false RegexMatchParameters: title: Regex Match Parameters type: object required: - rule properties: rule: type: string description: Regex pattern to match not: type: boolean description: If true, the check will fail when the regex pattern matches default: false AzurePIIParameters: title: Azure PII Parameters type: object properties: domain: type: string enum: - none - phi description: Domain to check against default: none apiVersion: type: string description: API version for the Content Safety API default: '2024-11-01' modelVersion: type: string description: Version of the PII detection model to use default: latest redact: type: boolean description: Whether to redact detected PII default: false timeout: type: number description: Timeout in milliseconds default: 5000 SydeGuardParameters: title: SydeGuard Parameters type: object properties: prompt_injection_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for prompt injection risk score (0-1) default: 0.5 toxicity_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for toxicity risk score (0-1) default: 0.5 evasion_threshold: type: number minimum: 0 maximum: 1 multipleOf: 0.01 description: Threshold for evasion risk score (0-1) default: 0.5 timeout: type: number description: Timeout in milliseconds default: 5000 GuardrailCheck: type: object required: - id properties: id: type: string description: Identifier of the guardrail check type enum: - default.jwt - default.modelWhitelist - default.isAllLowerCase - default.regexMatch - default.sentenceCount - default.wordCount - default.characterCount - default.jsonSchema - default.jsonKeys - default.contains - default.validUrls - default.containsCode - default.webhook - default.endsWith - default.alluppercase - default.requiredMetadataKeys - default.allowedRequestTypes - portkey.moderateContent - portkey.language - portkey.pii - portkey.gibberish - sydelabs.sydeguard - aporia.validateProject - pillar.scanPrompt - pillar.scanResponse - patronus.phi - patronus.pii - patronus.isConcise - patronus.isHelpful - patronus.isPolite - patronus.noApologies - patronus.noGenderBias - patronus.noRacialBias - patronus.retrievalAnswerRelevance - patronus.toxicity - patronus.custom - mistral.moderateContent - bedrock.guard - promptfoo.guard - promptfoo.pii - promptfoo.harm - acuvity.scan - lasso.classify - azure.contentSafety - azure.pii - panw-prisma-airs.intercept parameters: oneOf: - $ref: '#/components/schemas/JWTParameters' - $ref: '#/components/schemas/ModelWhitelistParameters' - $ref: '#/components/schemas/RegexMatchParameters' - $ref: '#/components/schemas/SentenceCountParameters' - $ref: '#/components/schemas/WordCountParameters' - $ref: '#/components/schemas/CharacterCountParameters' - $ref: '#/components/schemas/JSONSchemaParameters' - $ref: '#/components/schemas/JSONKeysParameters' - $ref: '#/components/schemas/ContainsParameters' - $ref: '#/components/schemas/ValidUrlsParameters' - $ref: '#/components/schemas/ContainsCodeParameters' - $ref: '#/components/schemas/WebhookParameters' - $ref: '#/components/schemas/EndsWithParameters' - $ref: '#/components/schemas/UppercaseParameters' - $ref: '#/components/schemas/RequiredMetadataKeysParameters' - $ref: '#/components/schemas/AllowedRequestTypesParameters' - $ref: '#/components/schemas/SydeGuardParameters' - $ref: '#/components/schemas/AporiaParameters' - $ref: '#/components/schemas/PillarScanParameters' - $ref: '#/components/schemas/PatronusParameters' - $ref: '#/components/schemas/PatronusCustomParameters' - $ref: '#/components/schemas/PortkeyModerationParameters' - $ref: '#/components/schemas/PortkeyLanguageParameters' - $ref: '#/components/schemas/PortkeyPIIParameters' - $ref: '#/components/schemas/MistralModerationParameters' - $ref: '#/components/schemas/BedrockGuardParameters' - $ref: '#/components/schemas/PromptfooParameters' - $ref: '#/components/schemas/AcuvityScanParameters' - $ref: '#/components/schemas/AzureContentSafetyParameters' - $ref: '#/components/schemas/AzurePIIParameters' - $ref: '#/components/schemas/PANWPrismaParameters' - $ref: '#/components/schemas/BasicParameters' description: Configuration parameters specific to the check type name: type: string description: Custom name for this specific check instance is_enabled: type: boolean description: Whether this check is enabled default: true CreateGuardrailResponse: type: object required: - id - slug - version_id properties: id: type: string description: Unique identifier of the created guardrail slug: type: string description: URL-friendly slug for the guardrail version_id: type: string description: Version identifier for the guardrail configuration PortkeyModerationParameters: title: Portkey Moderation Parameters type: object required: - categories properties: categories: type: array items: type: string enum: - hate - hate/threatening - harassment - harassment/threatening - self-harm - self-harm/intent - self-harm/instructions - sexual - sexual/minors - violence - violence/graphic description: Categories that should NOT be allowed timeout: type: number description: Timeout in milliseconds default: 5000 PillarScanParameters: title: Pillar Scan Parameters type: object required: - scanners properties: scanners: type: array items: type: string enum: - prompt_injection - pii - secrets - toxic_language - invisible_characters description: Scanners to use for content analysis timeout: type: number description: Timeout in milliseconds default: 5000 securitySchemes: Portkey-Key: type: apiKey in: header name: x-portkey-api-key Virtual-Key: type: apiKey in: header name: x-portkey-virtual-key Provider-Auth: type: http scheme: bearer Provider-Name: type: apiKey in: header name: x-portkey-provider Config: type: apiKey in: header name: x-portkey-config Custom-Host: type: apiKey in: header name: x-portkey-custom-host x-server-groups: ControlPlaneServers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint - url: SELF_HOSTED_CONTROL_PLANE_URL description: Self-Hosted Control Plane URL DataPlaneServers: - url: https://api.portkey.ai/v1 description: Portkey API Public Endpoint - url: SELF_HOSTED_GATEWAY_URL description: Self-Hosted Gateway URL PublicServers: - url: https://api.portkey.ai description: Portkey Public API (no auth required) x-mint: mcp: enabled: true name: Portkey MCP description: Official MCP Server for Portkey Docs & APIs x-code-samples: navigationGroups: - id: endpoints title: Endpoints - id: assistants title: Assistants - id: legacy title: Legacy groups: - id: audio title: Audio description: 'Learn how to turn audio into text or text into audio. Related guide: [Speech to text](https://platform.openai.com/docs/guides/speech-to-text) ' navigationGroup: endpoints sections: - type: endpoint key: createSpeech path: createSpeech - type: endpoint key: createTranscription path: createTranscription - type: endpoint key: createTranslation path: createTranslation - type: object key: CreateTranscriptionResponseJson path: json-object - type: object key: CreateTranscriptionResponseVerboseJson path: verbose-json-object - id: chat title: Chat description: 'Given a list of messages comprising a conversation, the model will return a response. Related guide: [Chat Completions](https://platform.openai.com/docs/guides/text-generation) ' navigationGroup: endpoints sections: - type: endpoint key: createChatCompletion path: create - type: object key: CreateChatCompletionResponse path: object - type: object key: CreateChatCompletionStreamResponse path: streaming - id: realtime title: Realtime description: 'WebSocket proxy for provider Realtime APIs (`GET` upgrade). Use `wss://` with the same `/v1` data-plane base as other gateway routes. Related guide: [OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime) ' navigationGroup: endpoints sections: - type: endpoint key: connectRealtime path: connect - id: embeddings title: Embeddings description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. Related guide: [Embeddings](https://platform.openai.com/docs/guides/embeddings) ' navigationGroup: endpoints sections: - type: endpoint key: createEmbedding path: create - type: object key: Embedding path: object - id: rerank title: Rerank description: 'Rerank a list of documents based on their relevance to a query. Reranking improves search results by scoring documents based on semantic relevance rather than keyword matching. Supported providers: Cohere, Voyage, Jina, Pinecone, Bedrock, Azure AI. ' navigationGroup: endpoints sections: - type: endpoint key: createRerank path: create - type: object key: CreateRerankResponse path: object - id: fine-tuning title: Fine-tuning description: 'Manage fine-tuning jobs to tailor a model to your specific training data. Related guide: [Fine-tune models](https://platform.openai.com/docs/guides/fine-tuning) ' navigationGroup: endpoints sections: - type: endpoint key: createFineTuningJob path: create - type: endpoint key: listPaginatedFineTuningJobs path: list - type: endpoint key: listFineTuningEvents path: list-events - type: endpoint key: listFineTuningJobCheckpoints path: list-checkpoints - type: endpoint key: retrieveFineTuningJob path: retrieve - type: endpoint key: cancelFineTuningJob path: cancel - type: object key: FinetuneChatRequestInput path: chat-input - type: object key: FinetuneCompletionRequestInput path: completions-input - type: object key: FineTuningJob path: object - type: object key: FineTuningJobEvent path: event-object - type: object key: FineTuningJobCheckpoint path: checkpoint-object - id: batch title: Batch description: 'Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount. Related guide: [Batch](https://platform.openai.com/docs/guides/batch) ' navigationGroup: endpoints sections: - type: endpoint key: createBatch path: create - type: endpoint key: retrieveBatch path: retrieve - type: endpoint key: cancelBatch path: cancel - type: endpoint key: listBatches path: list - type: object key: Batch path: object - type: object key: BatchRequestInput path: request-input - type: object key: BatchRequestOutput path: request-output - id: files title: Files description: 'Files are used to upload documents that can be used with features like [Assistants](https://platform.openai.com/docs/api-reference/assistants), [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning), and [Batch API](https://platform.openai.com/docs/guides/batch). ' navigationGroup: endpoints sections: - type: endpoint key: createFile path: create - type: endpoint key: listFiles path: list - type: endpoint key: retrieveFile path: retrieve - type: endpoint key: deleteFile path: delete - type: endpoint key: downloadFile path: retrieve-contents - type: object key: OpenAIFile path: object - id: images title: Images description: 'Given a prompt and/or an input image, the model will generate a new image. Related guide: [Image generation](https://platform.openai.com/docs/guides/images) ' navigationGroup: endpoints sections: - type: endpoint key: createImage path: create - type: endpoint key: createImageEdit path: createEdit - type: endpoint key: createImageVariation path: createVariation - type: object key: Image path: object - id: models title: Models description: 'List and describe the various models available in the API. You can refer to the [Models](https://platform.openai.com/docs/models) documentation to understand what models are available and the differences between them. ' navigationGroup: endpoints sections: - type: endpoint key: listModels path: list - type: endpoint key: retrieveModel path: retrieve - type: endpoint key: deleteModel path: delete - type: object key: Model path: object - id: moderations title: Moderations description: 'Given some input text, outputs if the model classifies it as potentially harmful across several categories. Related guide: [Moderations](https://platform.openai.com/docs/guides/moderation) ' navigationGroup: endpoints sections: - type: endpoint key: createModeration path: create - type: object key: CreateModerationResponse path: object - id: assistants title: Assistants beta: true description: 'Build assistants that can call models and use tools to perform tasks. [Get started with the Assistants API](https://platform.openai.com/docs/assistants) ' navigationGroup: assistants sections: - type: endpoint key: createAssistant path: createAssistant - type: endpoint key: listAssistants path: listAssistants - type: endpoint key: getAssistant path: getAssistant - type: endpoint key: modifyAssistant path: modifyAssistant - type: endpoint key: deleteAssistant path: deleteAssistant - type: object key: AssistantObject path: object - id: threads title: Threads beta: true description: 'Create threads that assistants can interact with. Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: createThread path: createThread - type: endpoint key: getThread path: getThread - type: endpoint key: modifyThread path: modifyThread - type: endpoint key: deleteThread path: deleteThread - type: object key: ThreadObject path: object - id: messages title: Messages beta: true description: 'Create messages within threads Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: createMessage path: createMessage - type: endpoint key: listMessages path: listMessages - type: endpoint key: getMessage path: getMessage - type: endpoint key: modifyMessage path: modifyMessage - type: endpoint key: deleteMessage path: deleteMessage - type: object key: MessageObject path: object - id: runs title: Runs beta: true description: 'Represents an execution run on a thread. Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: createRun path: createRun - type: endpoint key: createThreadAndRun path: createThreadAndRun - type: endpoint key: listRuns path: listRuns - type: endpoint key: getRun path: getRun - type: endpoint key: modifyRun path: modifyRun - type: endpoint key: submitToolOuputsToRun path: submitToolOutputs - type: endpoint key: cancelRun path: cancelRun - type: object key: RunObject path: object - id: run-steps title: Run Steps beta: true description: 'Represents the steps (model and tool calls) taken during the run. Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) ' navigationGroup: assistants sections: - type: endpoint key: listRunSteps path: listRunSteps - type: endpoint key: getRunStep path: getRunStep - type: object key: RunStepObject path: step-object - id: vector-stores title: Vector Stores beta: true description: 'Vector stores are used to store files for use by the `file_search` tool. Related guide: [File Search](https://platform.openai.com/docs/assistants/tools/file-search) ' navigationGroup: assistants sections: - type: endpoint key: createVectorStore path: create - type: endpoint key: listVectorStores path: list - type: endpoint key: getVectorStore path: retrieve - type: endpoint key: modifyVectorStore path: modify - type: endpoint key: deleteVectorStore path: delete - type: object key: VectorStoreObject path: object - id: vector-stores-files title: Vector Store Files beta: true description: 'Vector store files represent files inside a vector store. Related guide: [File Search](https://platform.openai.com/docs/assistants/tools/file-search) ' navigationGroup: assistants sections: - type: endpoint key: createVectorStoreFile path: createFile - type: endpoint key: listVectorStoreFiles path: listFiles - type: endpoint key: getVectorStoreFile path: getFile - type: endpoint key: deleteVectorStoreFile path: deleteFile - type: object key: VectorStoreFileObject path: file-object - id: vector-stores-file-batches title: Vector Store File Batches beta: true description: 'Vector store file batches represent operations to add multiple files to a vector store. Related guide: [File Search](https://platform.openai.com/docs/assistants/tools/file-search) ' navigationGroup: assistants sections: - type: endpoint key: createVectorStoreFileBatch path: createBatch - type: endpoint key: getVectorStoreFileBatch path: getBatch - type: endpoint key: cancelVectorStoreFileBatch path: cancelBatch - type: endpoint key: listFilesInVectorStoreBatch path: listBatchFiles - type: object key: VectorStoreFileBatchObject path: batch-object - id: assistants-streaming title: Streaming beta: true description: 'Stream the result of executing a Run or resuming a Run after submitting tool outputs. You can stream events from the [Create Thread and Run](https://platform.openai.com/docs/api-reference/runs/createThreadAndRun), [Create Run](https://platform.openai.com/docs/api-reference/runs/createRun), and [Submit Tool Outputs](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoints by passing `"stream": true`. The response will be a [Server-Sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events) stream. Our Node and Python SDKs provide helpful utilities to make streaming easy. Reference the [Assistants API quickstart](https://platform.openai.com/docs/assistants/overview) to learn more. ' navigationGroup: assistants sections: - type: object key: MessageDeltaObject path: message-delta-object - type: object key: RunStepDeltaObject path: run-step-delta-object - type: object key: AssistantStreamEvent path: events - id: completions title: Completions legacy: true navigationGroup: legacy description: 'Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](https://platform.openai.com/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. ' sections: - type: endpoint key: createCompletion path: create - type: object key: CreateCompletionResponse path: object