Cygnal
Cygnal Completions
Create OpenAI-compatible chat completions with Cygnal protection.
Docs: Guide | API Reference
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
Default
1prediction?|
audio?|
presence_penalty?|
response_format?|
seed?|
service_tier?|
stop?array<>||
store?|
stream?|
Default
falsestream_options?|
temperature?|
Default
1top_p?|
Default
1tools?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"
}
}