POST
/
ai-proxy
/
chat
/
completions
curl --request POST \
  --url https://api.enkryptai.com/ai-proxy/chat/completions \
  --header 'Content-Type: application/json' \
  --header 'X-Enkrypt-Deployment: <x-enkrypt-deployment>' \
  --header 'apikey: <api-key>' \
  --data '{
  "model": "mistralai/Mixtral-8x7B-Instruct-v0.1",
  "messages": [
    {
      "role": "user",
      "content": "hi"
    }
  ]
}'
{
  "id": "9023e384d9fa3af9",
  "object": "chat.completion",
  "created": 1736923377,
  "model": "mistralai/Mixtral-8x7B-Instruct-v0.1",
  "prompt": [],
  "choices": [
    {
      "finish_reason": "eos",
      "seed": 9320035192991048000,
      "logprobs": null,
      "index": 0,
      "message": {
        "role": "assistant",
        "content": " Hello! How can I help you today? If you have any questions about a specific topic or just want to chat, feel free to ask. I'm here to provide information and engage in a friendly conversation.",
        "tool_calls": []
      }
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 44,
    "total_tokens": 54
  },
  "enkrypt_policy_detections": {
    "output_guardrails": {
      "details": {
        "keyword_detector": {
          "detected_counts": {},
          "redacted_text": " Hello! How can I assist you today?",
          "detected_keywords": {}
        },
        "policy_violation": {
          "violating_policy": "No Violation Found",
          "explanation": "No Violation Found."
        },
        "bias": {
          "bias_detected": false,
          "debiased_text": "Hello! How may I help you today?"
        },
        "pii": {
          "ip_address": {},
          "url": {},
          "pii": {},
          "secrets": {}
        },
        "nsfw": {
          "sfw": 0.77364963293076,
          "nsfw": 0.14463838934898
        },
        "toxicity": {
          "threat": 0.00013719938579015,
          "severe_toxicity": 0.00013394378765952,
          "obscene": 0.00018259837816004,
          "insult": 0.00018637960602064,
          "toxicity": 0.00058524927590042,
          "identity_hate": 0.00014582877338398
        },
        "injection_attack": {
          "safe": "0.998087",
          "attack": "0.001913"
        }
      },
      "summary": {
        "keyword_detected": 0,
        "policy_violation": 0,
        "bias": 0,
        "pii": 0,
        "nsfw": 0,
        "toxicity": {},
        "injection_attack": 0
      }
    },
    "input_guardrails": {
      "details": {
        "keyword_detector": {
          "detected_counts": {},
          "redacted_text": "|",
          "detected_keywords": {}
        },
        "policy_violation": {
          "violating_policy": "No Violation Found",
          "explanation": "No Violation Found."
        },
        "bias": {
          "bias_detected": false,
          "debiased_text": "No rephrasing needed."
        },
        "pii": {
          "ip_address": {},
          "url": {},
          "pii": {},
          "secrets": {}
        },
        "nsfw": {
          "sfw": 0.23262414336205,
          "nsfw": 0.75041556358337
        },
        "toxicity": {
          "threat": 0.0001007060345728,
          "severe_toxicity": 0.00010207855666522,
          "obscene": 0.00019277907267679,
          "insult": 0.00018571241525933,
          "toxicity": 0.0011186309857294,
          "identity_hate": 0.00013926414248999
        },
        "injection_attack": {
          "safe": "0.999906",
          "attack": "0.000094"
        }
      },
      "summary": {
        "keyword_detected": 0,
        "policy_violation": 0,
        "bias": 0,
        "pii": 0,
        "nsfw": 1,
        "toxicity": {},
        "injection_attack": 0
      }
    }
  }
}

Authorizations

apikey
string
header
required

Headers

X-Enkrypt-Deployment
string
required

The deployment saved name. E.g. test-deployment-1

Example:

"test-deployment"

X-Enkrypt-Tags
string

Comma separated tags for the deployment if any

Example:

"openai-testing,unit-testing"

X-Enkrypt-Refresh-Cache
boolean

Refresh the cache if deployment, policy or model data is stale

Example:

false

Body

application/json

Response

200 - application/json
Successful Response

Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).