Skip to content

POST /responses

The Werker Health create-model-response endpoint mirrors the OpenAI Responses API. Use it for multi-turn, tool-aware generations that combine text, structured data, and function outputs in a single call.

Base URL: https://api.werker.health/v1

Request Overview

FieldTypeRequiredDescription
modelstringAny Werker-enabled model ID (e.g., gpt-4.1, gpt-4o-mini).
inputstring or arrayPrompts, messages, images, or tool outputs. Accepts the same union types defined by the OpenAI Responses schema.
response_formatobjectOptionalEnforce structured JSON schemas or json_schema definitions.
metadataobjectOptionalArbitrary key/value pairs stored with the call in immutable audit logs.
temperature, top_p, max_output_tokensnumberOptionalTuning controls identical to OpenAI.
streambooleanOptionalEnable server-sent event streaming.

All other OpenAI response request parameters—including parallel_tool_calls, tool_choice, and audio configuration—are supported without modification.

Quick Example

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.werker.health/v1",
    api_key="WERKER_HEALTH_API_KEY",
)

result = client.responses.create(
    model="gpt-5",
    input=[
        {"role": "system", "content": "You are a HIPAA-compliant care assistant."},
        {"role": "user", "content": "Summarize this visit note for the patient."},
    ],
    response_format={"type": "json_schema", "json_schema": {
        "name": "patient_summary",
        "schema": {
            "type": "object",
            "properties": {
                "summary": {"type": "string"},
                "follow_up_actions": {"type": "array", "items": {"type": "string"}}
            },
            "required": ["summary"]
        }
    }},
    metadata={"patient_visit_id": "visit-123"},
)

print(result.output_text)
ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.werker.health/v1",
  apiKey: "WERKER_HEALTH_API_KEY",
});

const result = await client.responses.create({
  model: "gpt-5",
  input: [
    { role: "system", content: "You are a HIPAA-compliant care assistant." },
    { role: "user", content: "Summarize this visit note for the patient." },
  ],
  response_format: {
    type: "json_schema",
    json_schema: {
      name: "patient_summary",
      schema: {
        type: "object",
        properties: {
          summary: { type: "string" },
          follow_up_actions: { type: "array", items: { type: "string" } }
        },
        required: ["summary"]
      }
    }
  },
  metadata: { patient_visit_id: "visit-123" },
});

console.log(result.output_text);

Streaming Responses

Werker Health streams responses via Server-Sent Events in the same format as OpenAI. Set stream=True (Python) or stream: true (JavaScript) and iterate over the event payloads. All streamed events are captured in immutable audit logs with PHI scrubbing applied in real time.

Compliance Considerations

  • Immutable logging: Each response call stores request/response metadata for audit readiness.
  • PHI scrubbing: Werker’s two-way redaction runs before data leaves your environment and upon return to ensure downstream tools never store raw PHI.
  • Zero retention: Calls to Werker-routed models are never retained for provider training.

When to Use

  • Unified text, JSON, tool invocation, and multimodal output in a single call.
  • Workflow automations that need deterministic JSON schemas.
  • Scenarios where you want Werker Health to orchestrate tool calls on your behalf.

For conversation-style experiences that use the legacy Chat Completions contract, use create-chat-completion.