Skip to main content

Azure OpenAI Integration

KoreShield can proxy Azure OpenAI requests to apply sanitization, detection, and policy enforcement before requests reach your Azure endpoint.

Model Names

In Azure OpenAI, the model field usually maps to your deployment name, not the base model name.

Setup

1

Get Azure Credentials

Obtain your Azure OpenAI endpoint, API key, and deployment name.
2

Configure KoreShield

Set up KoreShield proxy to route Azure OpenAI requests.
3

Update Application

Point your application to the KoreShield proxy endpoint.

Basic Request

const response = await fetch("http://localhost:8000/v1/chat/completions", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    model: "gpt-5-mini",
    messages: [{ role: "user", content: "Summarize the ticket backlog." }]
  })
});

Streaming

const response = await fetch("http://localhost:8000/v1/chat/completions", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    model: "gpt-5-mini",
    stream: true,
    messages: [{ role: "user", content: "Write an executive summary." }]
  })
});

System Prompts and Multi-Turn

{
  "model": "gpt-5-mini",
  "messages": [
    {"role": "system", "content": "You are a support analyst."},
    {"role": "user", "content": "Summarize the backlog."},
    {"role": "assistant", "content": "Summary..."},
    {"role": "user", "content": "Highlight top risks."}
  ]
}

Error Handling

  • 403 indicates a blocked request due to policy enforcement
  • 429 or 5xx typically indicates provider or rate-limit issues

Security Controls

security:
  sensitivity: medium
  default_action: block
  features:
    sanitization: true
    detection: true
    policy_enforcement: true

Next Steps

Configuration

Configure providers and security settings

JavaScript SDK

See SDK usage examples

Build docs developers (and LLMs) love