Cygnal

Cygnal Completions

Create OpenAI-compatible chat completions with Cygnal protection.

Docs: Guide | API Reference

POST
/cygnal/chat/completions

Request Body

application/json

messages*array<>
model*string
metadata?|
frequency_penalty?|
logit_bias?|
logprobs?|
top_logprobs?|
max_tokens?|
max_completion_tokens?|
modalities?array<>|
n?integer
Default1
prediction?|
audio?|
presence_penalty?|
response_format?|
seed?|
service_tier?|
stop?array<>||
store?|
stream?|
Defaultfalse
stream_options?|
temperature?|
Default1
top_p?|
Default1
tools?array<>|
tool_choice?|
Default"auto"
parallel_tool_calls?|
user?|
monitor_details?|
policy_id?|
function_call?||
functions?array<>|
moderate_before?|

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.grayswan.ai/cygnal/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "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  }'
{
  "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"
}
{
  "error": true,
  "message": "string",
  "detail": "string",
  "error_code": "string",
  "details": {
    "property1": "string",
    "property2": "string"
  }
}
{
  "error": true,
  "message": "string",
  "detail": "string",
  "error_code": "string",
  "details": {
    "property1": "string",
    "property2": "string"
  }
}
{
  "error": true,
  "message": "string",
  "detail": "string",
  "error_code": "string",
  "details": {
    "property1": "string",
    "property2": "string"
  }
}
{
  "error": true,
  "message": "string",
  "detail": "string",
  "error_code": "string",
  "details": {
    "property1": "string",
    "property2": "string"
  }
}