openapi: 3.1.0 info: title: Gray Swan AI Activity Cygnal API description: API for Gray Swan AI version: 0.1.0 servers: - url: https://api.grayswan.ai tags: - name: Cygnal paths: /cygnal/monitor: post: summary: Cygnal Monitor description: 'Monitors content for policy violations. This endpoint is used to check if the provided text contains harmful content or violates a given set of policies. Docs: [Guide](https://docs.grayswan.ai/cygnal/monitor-requests) | [API Reference](https://docs.grayswan.ai/api-reference/cygnal/monitor)' operationId: cygnal_monitor_cygnal_monitor_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateMonitorRequest' examples: text: summary: Simple text moderation request value: text: Hello, this is a test message for monitoring. reasoning_mode: 'off' message_parts: summary: Messages with array content parts value: messages: - role: system content: - type: text text: You are a helpful assistant. - role: user content: - type: input_text text: Hello - type: text text: Need help planning a trip. reasoning_mode: 'off' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/MonitoringResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '422': description: Unprocessable Content content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' tags: - Cygnal /cygnal/chat/completions: post: summary: Cygnal Completions description: 'Create OpenAI-compatible chat completions with Cygnal protection. Docs: [Guide](https://docs.grayswan.ai/cygnal/creating-completions) | [API Reference](https://docs.grayswan.ai/api-reference/cygnal/completions)' operationId: cygnal_completions_cygnal_chat_completions_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateChatCompletionRequest' examples: basic: summary: Basic completion request value: model: gpt-4 messages: - role: system content: You are a helpful assistant. - role: user content: I need you to help me with something. stream: false temperature: 0.7 max_tokens: 1000 with_tools: summary: Completion request with tool calls value: model: gpt-4 messages: - role: system content: You are a helpful assistant. - role: user content: What's the weather in San Francisco? tools: - type: function function: name: get_weather description: Get the current weather parameters: type: object properties: location: type: string description: The city and state required: - location stream: false required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/api__types__responses__openai_response__CreateChatCompletionResponse' text/event-stream: schema: type: string example: 'data: {"id":"example"} data: [DONE] ' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '422': description: Unprocessable Content content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' tags: - Cygnal /cygnal/v1/chat/completions: post: summary: Cygnal Completions description: 'Create OpenAI-compatible chat completions with Cygnal protection. Docs: [Guide](https://docs.grayswan.ai/cygnal/creating-completions) | [API Reference](https://docs.grayswan.ai/api-reference/cygnal/completions)' operationId: cygnal_completions_cygnal_v1_chat_completions_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateChatCompletionRequest' examples: basic: summary: Basic completion request value: model: gpt-4 messages: - role: system content: You are a helpful assistant. - role: user content: I need you to help me with something. stream: false temperature: 0.7 max_tokens: 1000 with_tools: summary: Completion request with tool calls value: model: gpt-4 messages: - role: system content: You are a helpful assistant. - role: user content: What's the weather in San Francisco? tools: - type: function function: name: get_weather description: Get the current weather parameters: type: object properties: location: type: string description: The city and state required: - location stream: false required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/api__types__responses__openai_response__CreateChatCompletionResponse' text/event-stream: schema: type: string example: 'data: {"id":"example"} data: [DONE] ' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '422': description: Unprocessable Content content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' tags: - Cygnal /cygnal/v1/messages: post: summary: Cygnal Anthropic Messages description: 'Create Anthropic-compatible messages with Cygnal protection. Docs: [Guide](https://docs.grayswan.ai/cygnal/creating-completions) | [API Reference](https://docs.grayswan.ai/api-reference/cygnal/anthropic-messages-v1)' operationId: cygnal_anthropic_messages_cygnal_v1_messages_post responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/api__types__responses__anthropic_response__CreateChatCompletionResponse' text/event-stream: schema: type: string example: 'data: {"id":"example"} data: [DONE] ' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '422': description: Unprocessable Content content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' tags: - Cygnal /cygnal/v1beta/models/{model}:generateContent: post: summary: Cygnal Gemini Generate description: 'Create Gemini-compatible generateContent responses with Cygnal protection. Docs: [Guide](https://docs.grayswan.ai/cygnal/creating-completions) | [API Reference](https://docs.grayswan.ai/api-reference/cygnal/gemini-generate-v1beta)' operationId: cygnal_gemini_generate_cygnal_v1beta_models__model__generateContent_post parameters: - name: model in: path required: true schema: type: string title: Model responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/GeminiGenerateContentResponse' '400': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Unauthorized '422': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Unprocessable Content '500': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Internal Server Error tags: - Cygnal /cygnal/v1beta/models/{model}:streamGenerateContent: post: summary: Cygnal Gemini Stream Generate Content description: 'Create Gemini-compatible streaming responses with Cygnal protection. Docs: [Guide](https://docs.grayswan.ai/cygnal/creating-completions) | [API Reference](https://docs.grayswan.ai/api-reference/cygnal/gemini-stream-generate-content-v1beta)' operationId: cygnal_gemini_stream_generate_content_cygnal_v1beta_models__model__streamGenerateContent_post parameters: - name: model in: path required: true schema: type: string title: Model responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/GeminiStreamChunkResponse' type: string example: '{"candidates":[{"content":{"parts":[{"text":"example"}]}}]}' '400': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Bad Request '401': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Unauthorized '422': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Unprocessable Content '500': content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' description: Internal Server Error tags: - Cygnal /cygnal/responses: post: summary: Cygnal Responses description: 'Process and monitor OpenAI-compatible response requests. This endpoint processes completion requests with monitoring capabilities, similar to the chat completions endpoint. Docs: [Guide](https://docs.grayswan.ai/cygnal/creating-responses) | [API Reference](https://docs.grayswan.ai/api-reference/cygnal/responses)' operationId: cygnal_responses_cygnal_responses_post requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateResponseRequest' required: true responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/ResponsesEndpointResponse' text/event-stream: schema: type: string example: 'data: {"id":"example"} data: [DONE] ' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '422': description: Unprocessable Content content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' '502': description: Bad Gateway content: application/json: schema: $ref: '#/components/schemas/StandardErrorResponse' tags: - Cygnal components: schemas: PIIScannerConfig: properties: pii_types: items: type: string type: array title: Pii Types type: object title: PIIScannerConfig description: Configuration for the PII scanner. ToolUseBlock: properties: type: type: string const: tool_use title: Type id: type: string title: Id name: type: string title: Name input: additionalProperties: $ref: '#/components/schemas/JSONValue-Output' type: object title: Input type: object required: - type - id - name - input title: ToolUseBlock description: Tool use block for Anthropic responses api__types__responses__anthropic_response__CreateChatCompletionResponse: properties: id: type: string title: Id type: type: string const: message title: Type role: type: string const: assistant title: Role content: items: anyOf: - $ref: '#/components/schemas/ContentBlock-Output' - $ref: '#/components/schemas/ToolUseBlock' type: array title: Content model: type: string title: Model stop_reason: anyOf: - type: string enum: - end_turn - max_tokens - stop_sequence - tool_use - content_filter - type: 'null' title: Stop Reason usage: anyOf: - $ref: '#/components/schemas/AnthropicUsage' - type: 'null' type: object required: - id - type - role - content - model title: CreateChatCompletionResponse description: Anthropic message response CompletionUsage: properties: completion_tokens: type: integer title: Completion Tokens prompt_tokens: type: integer title: Prompt Tokens total_tokens: type: integer title: Total Tokens completion_tokens_details: anyOf: - $ref: '#/components/schemas/CompletionTokensDetails' - type: 'null' prompt_tokens_details: anyOf: - $ref: '#/components/schemas/PromptTokensDetails' - type: 'null' additionalProperties: true type: object required: - completion_tokens - prompt_tokens - total_tokens title: CompletionUsage description: Usage statistics for the completion request. ChatCompletionResponseMessage: properties: content: anyOf: - type: string - type: 'null' title: Content role: type: string const: assistant title: Role tool_calls: anyOf: - items: $ref: '#/components/schemas/ChatCompletionMessageFunctionToolCall' type: array - type: 'null' title: Tool Calls type: object required: - role title: ChatCompletionResponseMessage GeminiSafetyRating: properties: category: anyOf: - type: string - type: 'null' title: Category probability: anyOf: - type: string - type: 'null' title: Probability blocked: anyOf: - type: boolean - type: 'null' title: Blocked additionalProperties: true type: object title: GeminiSafetyRating ResponsesEndpointResponse: properties: id: anyOf: - type: string - type: 'null' title: Id object: anyOf: - type: string - type: 'null' title: Object model: anyOf: - type: string - type: 'null' title: Model output: anyOf: - items: $ref: '#/components/schemas/JSONValue-Output' type: array - type: 'null' title: Output choices: anyOf: - items: $ref: '#/components/schemas/ResponseChoice' type: array - type: 'null' title: Choices usage: anyOf: - $ref: '#/components/schemas/ResponseUsage' - type: 'null' error: anyOf: - $ref: '#/components/schemas/ResponseError' - type: 'null' additionalProperties: true type: object title: ResponsesEndpointResponse MonitorTool: additionalProperties: $ref: '#/components/schemas/JSONValue-Input' type: object Prompt: properties: id: type: string title: Id variables: anyOf: - additionalProperties: true type: object - type: 'null' title: Variables version: anyOf: - type: string - type: 'null' title: Version type: object required: - id title: Prompt ChatCompletionRequestMessage: properties: role: type: string enum: - system - user - assistant - tool - function - developer title: Role content: anyOf: - type: string - type: 'null' title: Content tool_calls: anyOf: - items: $ref: '#/components/schemas/ChatCompletionMessageFunctionToolCall' type: array - type: 'null' title: Tool Calls tool_call_id: anyOf: - type: string - type: 'null' title: Tool Call Id type: object required: - role title: ChatCompletionRequestMessage GeminiContent: properties: parts: items: $ref: '#/components/schemas/GeminiPart' type: array title: Parts role: anyOf: - type: string - type: 'null' title: Role type: object required: - parts title: GeminiContent GeminiPart: properties: text: type: string title: Text type: object required: - text title: GeminiPart IgnoredInput: properties: type: type: string const: media title: Type reason: type: string const: text_moderation_only title: Reason description: type: string title: Description type: object required: - type - reason - description title: IgnoredInput description: Schema for inputs intentionally excluded before moderation. GeminiCandidate: properties: id: anyOf: - type: string - type: 'null' title: Id content: $ref: '#/components/schemas/GeminiContent' finish_reason: anyOf: - type: string - type: 'null' title: Finish Reason index: anyOf: - type: integer - type: 'null' title: Index safety_ratings: anyOf: - items: $ref: '#/components/schemas/GeminiSafetyRating' type: array - type: 'null' title: Safety Ratings type: object required: - content title: GeminiCandidate Conversation: properties: id: type: string title: Id type: object required: - id title: Conversation MonitorMessageContentPart: properties: type: type: string title: Type text: anyOf: - type: string - type: 'null' title: Text source: anyOf: - additionalProperties: $ref: '#/components/schemas/JSONValue-Input' type: object - type: 'null' title: Source input: anyOf: - additionalProperties: $ref: '#/components/schemas/JSONValue-Input' type: object - type: 'null' title: Input name: anyOf: - type: string - type: 'null' title: Name id: anyOf: - type: string - type: 'null' title: Id additionalProperties: true type: object required: - type title: MonitorMessageContentPart ToolChoiceName: properties: name: type: string title: Name type: object required: - name title: ToolChoiceName StandardErrorResponse: properties: error: type: boolean title: Error default: true message: type: string title: Message detail: type: string title: Detail error_code: anyOf: - type: string - type: 'null' title: Error Code details: anyOf: - additionalProperties: $ref: '#/components/schemas/JSONValue-Output' type: object - type: 'null' title: Details type: object required: - message - detail title: StandardErrorResponse CreateChatCompletionRequest: properties: messages: items: $ref: '#/components/schemas/ChatCompletionRequestMessage' type: array title: Messages model: type: string title: Model metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata frequency_penalty: anyOf: - type: number - type: 'null' title: Frequency Penalty logit_bias: anyOf: - additionalProperties: type: number type: object - type: 'null' title: Logit Bias logprobs: anyOf: - type: boolean - type: 'null' title: Logprobs top_logprobs: anyOf: - type: integer - type: 'null' title: Top Logprobs max_tokens: anyOf: - type: integer - type: 'null' title: Max Tokens max_completion_tokens: anyOf: - type: integer - type: 'null' title: Max Completion Tokens modalities: anyOf: - items: type: string type: array - type: 'null' title: Modalities n: type: integer title: N default: 1 prediction: anyOf: - {} - type: 'null' title: Prediction audio: anyOf: - {} - type: 'null' title: Audio presence_penalty: anyOf: - type: number - type: 'null' title: Presence Penalty response_format: anyOf: - {} - type: 'null' title: Response Format seed: anyOf: - type: integer - type: 'null' title: Seed service_tier: anyOf: - type: string - type: 'null' title: Service Tier stop: anyOf: - items: type: string type: array - type: string - type: 'null' title: Stop store: anyOf: - type: boolean - type: 'null' title: Store stream: anyOf: - type: boolean - type: 'null' title: Stream default: false stream_options: anyOf: - {} - type: 'null' title: Stream Options temperature: anyOf: - type: number - type: 'null' title: Temperature default: 1 top_p: anyOf: - type: number - type: 'null' title: Top P default: 1 tools: anyOf: - items: $ref: '#/components/schemas/Tool' type: array - type: 'null' title: Tools tool_choice: anyOf: - type: string enum: - none - auto - required - $ref: '#/components/schemas/ToolChoice' title: Tool Choice default: auto parallel_tool_calls: anyOf: - type: boolean - type: 'null' title: Parallel Tool Calls user: anyOf: - type: string - type: 'null' title: User monitor_details: anyOf: - type: boolean - type: 'null' title: Monitor Details policy_id: anyOf: - type: string - type: 'null' title: Policy Id function_call: anyOf: - type: string - additionalProperties: true type: object - type: 'null' title: Function Call functions: anyOf: - items: {} type: array - type: 'null' title: Functions moderate_before: anyOf: - type: boolean - type: 'null' title: Moderate Before type: object required: - messages - model title: CreateChatCompletionRequest ChatCompletionMessageFunctionToolCall: properties: id: type: string title: Id function: $ref: '#/components/schemas/Function' type: type: string const: function title: Type additionalProperties: true type: object required: - id - function - type title: ChatCompletionMessageFunctionToolCall description: A call to a function tool created by the model. CreateResponseRequest: properties: background: type: boolean title: Background default: false conversation: anyOf: - type: string - $ref: '#/components/schemas/Conversation' - type: 'null' title: Conversation include: anyOf: - items: {} type: array - type: 'null' title: Include input: anyOf: - type: string - items: {} type: array - type: 'null' title: Input instructions: anyOf: - type: string - type: 'null' title: Instructions max_output_tokens: anyOf: - type: integer - type: 'null' title: Max Output Tokens max_tool_calls: anyOf: - type: integer - type: 'null' title: Max Tool Calls metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata model: anyOf: - type: string - type: 'null' title: Model parallel_tool_calls: anyOf: - type: boolean - type: 'null' title: Parallel Tool Calls default: true previous_response: anyOf: - type: string - type: 'null' title: Previous Response prompt: anyOf: - $ref: '#/components/schemas/Prompt' - type: 'null' prompt_cache_key: anyOf: - type: string - type: 'null' title: Prompt Cache Key reasoning: anyOf: - additionalProperties: true type: object - type: 'null' title: Reasoning safety_identifier: anyOf: - type: string - type: 'null' title: Safety Identifier service_tier: anyOf: - type: string enum: - auto - default - flex - scale - priority - type: 'null' title: Service Tier store: anyOf: - type: boolean - type: 'null' title: Store default: true stream: anyOf: - type: boolean - type: 'null' title: Stream default: false stream_options: anyOf: - {} - type: 'null' title: Stream Options temperature: anyOf: - type: number - type: 'null' title: Temperature text: anyOf: - {} - type: 'null' title: Text tool_choice: anyOf: - type: string enum: - none - auto - required - $ref: '#/components/schemas/ToolChoice' title: Tool Choice default: auto tools: anyOf: - items: {} type: array - type: 'null' title: Tools top_logprobs: anyOf: - type: integer - type: 'null' title: Top Logprobs top_p: anyOf: - type: number - type: 'null' title: Top P truncation: anyOf: - type: string enum: - auto - disabled - type: 'null' title: Truncation default: disabled user: anyOf: - type: string - type: 'null' title: User monitor_details: anyOf: - type: boolean - type: 'null' title: Monitor Details policy_id: anyOf: - type: string - type: 'null' title: Policy Id type: object title: CreateResponseRequest ContentBlock-Output: properties: type: type: string const: text title: Type text: type: string title: Text type: object required: - type - text title: ContentBlock description: Base content block for Anthropic responses AnthropicUsage: properties: input_tokens: type: integer title: Input Tokens output_tokens: type: integer title: Output Tokens type: object required: - input_tokens - output_tokens title: AnthropicUsage description: Usage information for Anthropic API JSONValue-Input: anyOf: - $ref: '#/components/schemas/JSONPrimitive' - items: $ref: '#/components/schemas/JSONValue-Input' type: array - additionalProperties: $ref: '#/components/schemas/JSONValue-Input' type: object MonitorMessage: properties: role: $ref: '#/components/schemas/MonitorMessageRole' content: anyOf: - type: string - items: $ref: '#/components/schemas/MonitorMessageContentPart' type: array - type: 'null' title: Content tool_calls: anyOf: - items: $ref: '#/components/schemas/ChatCompletionMessageFunctionToolCall' type: array - type: 'null' title: Tool Calls tool_call_id: anyOf: - type: string - type: 'null' title: Tool Call Id name: anyOf: - type: string - type: 'null' title: Name type: object required: - role title: MonitorMessage RuleDescription: properties: rule: type: integer title: Rule name: type: string title: Name description: type: string title: Description type: object title: RuleDescription description: Schema for violated rule descriptions used in MonitoringResponse. api__types__responses__openai_response__CreateChatCompletionResponse: properties: id: type: string title: Id choices: items: $ref: '#/components/schemas/ChatCompletionChoice' type: array title: Choices created: type: integer title: Created model: type: string title: Model object: type: string const: chat.completion title: Object system_fingerprint: anyOf: - type: string - type: 'null' title: System Fingerprint usage: anyOf: - $ref: '#/components/schemas/CompletionUsage' - type: 'null' type: object required: - id - choices - created - model - object title: CreateChatCompletionResponse description: Based on OpenAI's official Completion type examples: - choices: - finish_reason: stop index: 0 message: content: Sure, just let me know what you'd like me to help with! role: assistant created: 1987654321 id: '1234567890' model: gpt-4o object: chat.completion system_fingerprint: v-0.2 ResponseUsage: properties: prompt_tokens: anyOf: - type: integer - type: 'null' title: Prompt Tokens completion_tokens: anyOf: - type: integer - type: 'null' title: Completion Tokens total_tokens: anyOf: - type: integer - type: 'null' title: Total Tokens input_tokens: anyOf: - type: integer - type: 'null' title: Input Tokens output_tokens: anyOf: - type: integer - type: 'null' title: Output Tokens additionalProperties: true type: object title: ResponseUsage SystemPromptScannerConfig: properties: system_prompt: type: string title: System Prompt type: object title: SystemPromptScannerConfig description: Configuration for the system prompt scanner. GeminiStreamChunkResponse: properties: candidates: items: $ref: '#/components/schemas/GeminiStreamCandidate' type: array title: Candidates type: object required: - candidates title: GeminiStreamChunkResponse JSONValue-Output: anyOf: - $ref: '#/components/schemas/JSONPrimitive' - items: $ref: '#/components/schemas/JSONValue-Output' type: array - additionalProperties: $ref: '#/components/schemas/JSONValue-Output' type: object GeminiPromptFeedback: properties: safety_ratings: anyOf: - items: $ref: '#/components/schemas/GeminiSafetyRating' type: array - type: 'null' title: Safety Ratings type: object title: GeminiPromptFeedback CompletionTokensDetails: properties: accepted_prediction_tokens: anyOf: - type: integer - type: 'null' title: Accepted Prediction Tokens audio_tokens: anyOf: - type: integer - type: 'null' title: Audio Tokens reasoning_tokens: anyOf: - type: integer - type: 'null' title: Reasoning Tokens rejected_prediction_tokens: anyOf: - type: integer - type: 'null' title: Rejected Prediction Tokens additionalProperties: true type: object title: CompletionTokensDetails description: Breakdown of tokens used in a completion. ChatCompletionChoice: properties: finish_reason: type: string enum: - stop - length - content_filter - tool_calls - violation title: Finish Reason index: type: integer title: Index message: $ref: '#/components/schemas/ChatCompletionResponseMessage' logprobs: anyOf: - type: string - type: 'null' title: Logprobs type: object required: - finish_reason - index - message title: ChatCompletionChoice ResponseChoice: properties: index: anyOf: - type: integer - type: 'null' title: Index finish_reason: anyOf: - type: string - type: 'null' title: Finish Reason message: anyOf: - $ref: '#/components/schemas/ResponseMessage' - type: 'null' additionalProperties: true type: object title: ResponseChoice GeminiGenerateContentResponse: properties: id: type: string title: Id candidates: items: $ref: '#/components/schemas/GeminiCandidate' type: array title: Candidates prompt_feedback: anyOf: - $ref: '#/components/schemas/GeminiPromptFeedback' - type: 'null' usage_metadata: anyOf: - $ref: '#/components/schemas/GeminiUsageMetadata' - type: 'null' type: object required: - id - candidates title: GeminiGenerateContentResponse PromptTokensDetails: properties: audio_tokens: anyOf: - type: integer - type: 'null' title: Audio Tokens cached_tokens: anyOf: - type: integer - type: 'null' title: Cached Tokens additionalProperties: true type: object title: PromptTokensDetails description: Breakdown of tokens used in the prompt. ResponseMessage: properties: role: anyOf: - type: string - type: 'null' title: Role content: anyOf: - type: string - type: 'null' title: Content additionalProperties: true type: object title: ResponseMessage MonitoringResponse: properties: violation: type: number title: Violation default: 0.0 observe_violation: anyOf: - type: number - type: 'null' title: Observe Violation violated_rules: items: type: integer type: array title: Violated Rules default: [] violated_rule_descriptions: items: $ref: '#/components/schemas/RuleDescription' type: array title: Violated Rule Descriptions default: [] ignored_inputs: items: $ref: '#/components/schemas/IgnoredInput' type: array title: Ignored Inputs default: [] ipi: type: boolean title: Ipi default: false mutation: type: boolean title: Mutation default: false scanner_output: anyOf: - additionalProperties: true type: object - type: 'null' title: Scanner Output reasoning: anyOf: - type: string - type: 'null' title: Reasoning input_tokens: anyOf: - type: integer - type: 'null' title: Input Tokens output_tokens: anyOf: - type: integer - type: 'null' title: Output Tokens activity_id: anyOf: - type: string - type: 'null' title: Activity Id block_message: anyOf: - type: string - type: 'null' title: Block Message error: type: boolean title: Error default: false error_message: anyOf: - type: string - type: 'null' title: Error Message type: object title: MonitoringResponse description: 'Response schema for monitoring/moderation results. Also used as the structure for pre_analysis and post_generation_analysis dicts in activity logging.' MonitorMessageRole: type: string enum: - system - user - assistant - tool - developer ToolChoice: properties: type: type: string title: Type function: $ref: '#/components/schemas/ToolChoiceName' type: object required: - type - function title: ToolChoice JSONPrimitive: anyOf: - type: string - type: integer - type: number - type: boolean - type: 'null' Tool: properties: type: type: string title: Type function: $ref: '#/components/schemas/api__types__requests__openai_request__ToolFunction' type: object required: - type - function title: Tool Function: properties: arguments: type: string title: Arguments name: type: string title: Name additionalProperties: true type: object required: - arguments - name title: Function description: The function that the model called. api__types__requests__openai_request__ToolFunction: properties: name: type: string title: Name description: type: string title: Description parameters: additionalProperties: true type: object title: Parameters required: anyOf: - items: type: string type: array - type: 'null' title: Required type: object required: - name - description - parameters title: ToolFunction ResponseError: properties: message: anyOf: - type: string - type: 'null' title: Message type: anyOf: - type: string - type: 'null' title: Type code: anyOf: - type: string - type: 'null' title: Code param: anyOf: - type: string - type: 'null' title: Param additionalProperties: true type: object title: ResponseError GeminiStreamCandidate: properties: content: $ref: '#/components/schemas/GeminiContent' finishReason: anyOf: - type: string - type: 'null' title: Finishreason type: object required: - content title: GeminiStreamCandidate GeminiUsageMetadata: properties: prompt_token_count: anyOf: - type: integer - type: 'null' title: Prompt Token Count candidates_token_count: anyOf: - type: integer - type: 'null' title: Candidates Token Count total_token_count: anyOf: - type: integer - type: 'null' title: Total Token Count type: object title: GeminiUsageMetadata CreateMonitorRequest: properties: text: anyOf: - type: string - type: 'null' title: Text messages: anyOf: - items: $ref: '#/components/schemas/MonitorMessage' type: array - type: 'null' title: Messages tools: anyOf: - items: $ref: '#/components/schemas/MonitorTool' type: array - type: 'null' title: Tools metadata: anyOf: - additionalProperties: $ref: '#/components/schemas/JSONValue-Input' type: object - type: 'null' title: Metadata categories: anyOf: - additionalProperties: type: string type: object - items: type: string type: array - items: additionalProperties: type: string type: object type: array - type: 'null' title: Categories rules: anyOf: - additionalProperties: type: string type: object - items: type: string type: array - items: additionalProperties: type: string type: object type: array - type: 'null' title: Rules reasoning_mode: anyOf: - type: string enum: - 'off' - thinking - hybrid - type: 'null' title: Reasoning Mode default: 'off' policy_id: anyOf: - type: string - type: 'null' title: Policy Id policy_ids: anyOf: - items: type: string type: array - type: 'null' title: Policy Ids scanner_configs: anyOf: - items: additionalProperties: anyOf: - $ref: '#/components/schemas/PIIScannerConfig' - $ref: '#/components/schemas/SystemPromptScannerConfig' - additionalProperties: true type: object type: object type: array - type: 'null' title: Scanner Configs litellm_metadata: anyOf: - additionalProperties: $ref: '#/components/schemas/JSONValue-Input' type: object - type: 'null' title: Litellm Metadata type: object title: CreateMonitorRequest