Cygnal

Cygnal Completions

POST
/cygnal/chat/completions

Create OpenAI-compatible chat completions with Cygnal protection.

Docs: Guide | API Reference

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/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"}