Developer

Quickstart

Send your first request in a few minutes. The API speaks the OpenAI chat completions format, so the OpenAI SDKs work once you change the base URL.

Do not send protected health information yet.A Business Associate Agreement (BAA) with Health Council must be signed before any protected health information reaches the API. Use synthetic or deidentified data until then.

1. Create an API key

Keys authenticate every request. Create one in the console and copy it right away: the full key is shown once. New keys can chat and use the knowledge base; turn on billing permissions only for keys that need them.

2. Keep the key out of your code

Store the key in an environment variable or a secret manager. Never ship it in browser or mobile code.

Shell
export COUNCIL_API_KEY="cai_live_..."

3. Install an SDK

The API accepts the OpenAI chat completions format, so the official OpenAI SDKs work as they are. You only change the base URL.

Python

pip install openai

Node.js

npm install openai

curl

curl --version

4. Send a request

Point the client at https://developer.council.health/v1 and call chat completions.

Python

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://developer.council.health/v1",
    api_key=os.environ["COUNCIL_API_KEY"],
)

response = client.chat.completions.create(
    model="YOUR_MODEL_ID",  # GET /v1/models lists yours
    messages=[{"role": "user", "content": "Summarize first line treatment for hypertension."}],
)

print(response.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://developer.council.health/v1",
  apiKey: process.env.COUNCIL_API_KEY,
});

const response = await client.chat.completions.create({
  model: "YOUR_MODEL_ID", // GET /v1/models lists yours
  messages: [{ role: "user", content: "Summarize first line treatment for hypertension." }],
});

console.log(response.choices[0].message.content);

curl

curl https://developer.council.health/v1/chat/completions \
  -H "Authorization: Bearer $COUNCIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "messages": [{ "role": "user", "content": "Summarize first line treatment for hypertension." }]
  }'

5. Read the response

Responses follow the OpenAI shape, including token usage when the model reports it. The console shows requests and spend on the Usage page.

Response
{
  "id": "chatcmpl_...",
  "object": "chat.completion",
  "model": "YOUR_MODEL_ID",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Guidelines recommend lifestyle changes for everyone with high blood pressure..."
    },
    "finish_reason": "stop"
  }],
  "usage": { "prompt_tokens": 18, "completion_tokens": 96, "total_tokens": 114 }
}

Sample response for illustration. Not medical advice.

Next steps