Authentication

API access requires an API key passed via the Authorization header. Keys are scoped per organization and environment (sandbox vs production).

HTTP Header
Authorization: Bearer kvec_sk_live_your_api_key_here

Early access. API keys are not yet self-serve. Request access to get sandbox credentials — we'll have you live in 24 hours.

Key Format

EnvironmentPrefixExample
Sandbox kvec_sk_test_ For development and testing
Production kvec_sk_live_ For production traffic

Demo mode. The live demo does not require authentication. The examples below work without an API key against the demo endpoint. Production deployments will require auth.

POST /api/search

The core endpoint. Accepts a plain-language symptom description and returns clinically-coded provider matches.

POST /api/search Search providers by symptoms

Request Body

Send a JSON body with the patient's symptom description.

FieldTypeRequiredDescription
query string Required Symptom description in plain language. Min 3 chars, max 1000 chars.
limit integer Optional Maximum number of providers to return. Default: 5, Max: 10
min_confidence float Optional Minimum confidence threshold for condition matching. Default: 0.3, Range: 0–1
POST /api/search
{
  "query": "I get really bad headaches behind my eyes and feel nauseous",
  "limit": 5,
  "min_confidence": 0.3
}

Response

Returns clinical mappings and ranked providers. All responses include a success boolean.

Top-Level Fields

FieldTypeDescription
success boolean Whether the request succeeded
results.query string Echo of the input query
results.method string "embedding" or "keyword" — which matching engine was used
results.latency_ms integer Server-side processing time in milliseconds
results.clinical_mapping object Clinical code mappings (see below)
results.providers array Ranked provider matches (see below)
results.metadata object Engine metadata (model version, counts)

clinical_mapping Object

FieldTypeDescription
primary_condition object | null Highest-confidence condition match
detected_conditions array All matched conditions, sorted by confidence
  .id string Rosetta Health condition identifier (e.g., "migraine-with-aura")
  .name string Clinical condition name
  .icd10 string ICD-10-CM code (e.g., "G43.1")
  .snomed_ct string SNOMED-CT concept ID (e.g., "37796009")
  .category string Clinical category: neurological, musculoskeletal, cardiovascular, etc.
  .confidence float Match confidence score (0–1)
  .specialties array Relevant medical specialties for this condition

providers[] Object

FieldTypeDescription
rank integer Position in results (1 = best match)
confidence_score float Overall match score (0–0.99)
reasoning string Human-readable explanation of why this provider matched
matched_conditions array Conditions this provider treats that matched the query
matched_specialties array Provider specialties relevant to matched conditions
provider.id string Provider identifier
provider.name string Full name
provider.credentials string Medical credentials (e.g., "MD, FAHS")
provider.title string Primary title (e.g., "Neurologist")
provider.specialties array Subspecialty areas
provider.bio string Provider biography
provider.location object { city, state, distance_miles }
provider.accepting_patients boolean Whether accepting new patients
provider.languages array Spoken languages
provider.insurance array Accepted insurance plans
provider.rating float Patient rating (1–5)
provider.review_count integer Number of patient reviews
provider.next_available string Next available appointment
provider.npi string National Provider Identifier
provider.gender string "M" or "F"

Full Response Example

200 OK — application/json
{
  "success": true,
  "results": {
    "query": "I get really bad headaches behind my eyes and feel nauseous",
    "method": "embedding",
    "latency_ms": 142,
    "clinical_mapping": {
      "primary_condition": {
        "id": "migraine-with-aura",
        "name": "Migraine with aura",
        "icd10": "G43.1",
        "snomed_ct": "37796009",
        "category": "neurological",
        "confidence": 0.97,
        "specialties": ["neurology", "headache-medicine"]
      },
      "detected_conditions": [
        { "id": "migraine-with-aura", "name": "Migraine with aura", "icd10": "G43.1", "confidence": 0.97 },
        { "id": "tension-headache", "name": "Tension-type headache", "icd10": "G44.2", "confidence": 0.72 }
      ]
    },
    "providers": [
      {
        "rank": 1,
        "confidence_score": 0.97,
        "reasoning": "Treats Migraine with aura · Neurology specialist · accepting new patients · 2.1mi away",
        "matched_conditions": [
          { "id": "migraine-with-aura", "name": "Migraine with aura", "icd10": "G43.1" }
        ],
        "matched_specialties": ["Neurology", "Headache Medicine"],
        "provider": {
          "id": "provider-001",
          "name": "Dr. Sarah Chen",
          "credentials": "MD, FAHS",
          "title": "Neurologist",
          "specialties": ["Headache & Migraine", "Epilepsy", "Neuropathic Pain"],
          "location": { "city": "Midtown", "state": "NY", "distance_miles": 2.1 },
          "accepting_patients": true,
          "languages": ["English", "Mandarin"],
          "insurance": ["Aetna", "BlueCross BlueShield", "UnitedHealthcare"],
          "rating": 4.9,
          "review_count": 284,
          "next_available": "2 days",
          "npi": "1234567890",
          "gender": "F"
        }
      }
    ],
    "metadata": {
      "total_providers_evaluated": 5,
      "total_conditions_evaluated": 25,
      "embedding_model": "text-embedding-3-small",
      "version": "1.0.0-demo"
    }
  }
}

Error Handling

All error responses include success: false and an error message.

StatusCauseError Message
400 Missing or invalid query field "Missing or invalid \"query\" field."
400 Query shorter than 3 characters "Query too short."
400 Query exceeds 1000 characters "Query too long."
500 Internal server error "Search failed. Please try again."
400 Bad Request
{
  "success": false,
  "error": "Missing or invalid \"query\" field. Provide a symptom description string."
}

Clinical Mapping

Rosetta Health translates plain-language symptom descriptions into standardized clinical codes using embedding-based semantic matching.

How It Works

1
Patient Input
"Bad headaches behind my eyes"
2
Embed
Convert to vector via text-embedding-3-small
3
Match
Cosine similarity against 25+ clinical conditions
4
Code
G43.1 (ICD-10) + 37796009 (SNOMED-CT)

Each clinical condition in the Rosetta Health knowledge base includes:

  • Clinical description — medical terminology used by practitioners
  • Patient language model — how real patients describe the condition
  • ICD-10-CM code — standard billing and diagnosis code
  • SNOMED-CT code — international clinical terminology identifier
  • Specialty mapping — which medical specialties treat this condition

Supported Clinical Categories

CategoryExample ConditionsExample Codes
neurological Migraine with aura, Tension headache, Carpal tunnel G43.1 G44.2 G56.0
musculoskeletal Knee osteoarthritis, Lumbar radiculopathy, Rotator cuff tear M17.9 M54.1 M75.1
cardiovascular Atrial fibrillation, Hypertension, Chest pain I48.91 I10 R07.9
mental-health Major depression, Generalized anxiety, PTSD F32.9 F41.1 F43.1
endocrine Type 2 diabetes, Hypothyroidism E11.9 E03.9
respiratory Asthma, COPD, Sleep apnea, Allergic rhinitis J45.909 J44.1 G47.33
gastrointestinal GERD, Irritable bowel syndrome K21.0 K58.9
dermatological Atopic dermatitis (eczema) L20.9

Expanding coverage. The clinical knowledge base is growing. Production deployments can be customized with your organization's specific condition and provider profiles.

Keyword Fallback

If the embedding engine is temporarily unavailable, Rosetta Health falls back to keyword-based matching. The response method field indicates which engine was used: "embedding" or "keyword". Embedding-based matching is significantly more accurate for natural language queries.

Provider Matching

After clinical conditions are identified, Rosetta Health scores each provider based on two factors combined into a single confidence score.

Confidence Score Calculation

Each provider's confidence_score is a weighted composite:

FactorWeightWhat It Measures
Condition Match 60% How many of the detected conditions this provider treats, weighted by each condition's embedding confidence score
Specialty Match 40% How well the provider's specialties align with the specialties indicated by the detected conditions

Score interpretation. Scores above 0.80 indicate a strong clinical match. Scores between 0.50–0.80 indicate a moderate match. Scores below 0.50 suggest partial or tangential relevance.

Match Reasoning

Each provider result includes a reasoning string that explains the match in human-readable format. This can be displayed directly to end users:

Reasoning example
"Treats Migraine with aura · Neurology specialist · accepting new patients · 2.1mi away"

Provider Data

Each provider record includes rich metadata for display in your UI:

  • Demographics — name, credentials, title, gender, NPI
  • Clinical — subspecialties, treated conditions, bio
  • Access — location, distance, accepting status, next availability
  • Patient experience — rating, review count, languages
  • Insurance — accepted plans (filterable on your end)

Quick Start

Make your first API call in under a minute. The demo endpoint is live and requires no authentication.

Terminal
curl -X POST https://kvecos.polsia.app/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "my knee hurts when I walk up stairs"}'

That's it. You'll get back clinical code mappings and ranked providers in a single JSON response.

Code Examples

Copy-paste examples in JavaScript, Python, and cURL.

JavaScript (Node.js / Browser)
// Rosetta Health Provider Search — JavaScript
const BASE_URL = 'https://kvecos.polsia.app';

async function searchProviders(symptoms, options = {}) {
  const response = await fetch(`${BASE_URL}/api/search`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      // 'Authorization': 'Bearer kvec_sk_live_...'  // when using API key
    },
    body: JSON.stringify({
      query: symptoms,
      limit: options.limit || 5,
      min_confidence: options.min_confidence || 0.3
    })
  });

  const data = await response.json();

  if (!data.success) {
    throw new Error(data.error || 'Search failed');
  }

  return data.results;
}

// Example usage
const results = await searchProviders(
  'I get really bad headaches behind my eyes and feel nauseous'
);

// Primary clinical mapping
console.log(results.clinical_mapping.primary_condition);
// → { name: "Migraine with aura", icd10: "G43.1", snomed_ct: "37796009", confidence: 0.97 }

// Top provider
console.log(results.providers[0]);
// → { rank: 1, confidence_score: 0.97, provider: { name: "Dr. Sarah Chen", ... } }
Python (requests)
# Rosetta Health Provider Search — Python
import requests

BASE_URL = "https://kvecos.polsia.app"

def search_providers(symptoms, limit=5, min_confidence=0.3):
    response = requests.post(
        f"{BASE_URL}/api/search",
        json={
            "query": symptoms,
            "limit": limit,
            "min_confidence": min_confidence,
        },
        headers={
            "Content-Type": "application/json",
            # "Authorization": "Bearer kvec_sk_live_..."  # when using API key
        },
    )
    response.raise_for_status()
    data = response.json()

    if not data["success"]:
        raise Exception(data.get("error", "Search failed"))

    return data["results"]


# Example usage
results = search_providers(
    "I get really bad headaches behind my eyes and feel nauseous"
)

# Primary clinical mapping
primary = results["clinical_mapping"]["primary_condition"]
print(f"Condition: {primary['name']} (ICD-10: {primary['icd10']})")
# → Condition: Migraine with aura (ICD-10: G43.1)

# Top provider
top = results["providers"][0]
print(f"Best match: {top['provider']['name']} (score: {top['confidence_score']})")
# → Best match: Dr. Sarah Chen (score: 0.97)
cURL
# Basic search
curl -X POST https://kvecos.polsia.app/api/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "I get really bad headaches behind my eyes and feel nauseous",
    "limit": 5
  }'

# With minimum confidence threshold
curl -X POST https://kvecos.polsia.app/api/search \
  -H "Content-Type: application/json" \
  -d '{
    "query": "my knee hurts when I walk up stairs and feels stiff",
    "limit": 3,
    "min_confidence": 0.5
  }'

# With API key (production)
curl -X POST https://kvecos.polsia.app/api/search \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer kvec_sk_live_your_key_here" \
  -d '{
    "query": "heart feels like it is skipping beats",
    "limit": 5
  }'

# Pretty-print with jq
curl -s -X POST https://kvecos.polsia.app/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "always thirsty, peeing all the time"}' | jq '.'

Rate Limits & SLAs

100
Requests per minute
<500ms
p95 latency
99.9%
Uptime SLA

Rate Limit Details

TierRate LimitBurstDaily Cap
Sandbox 20 req/min 5 concurrent 1,000/day
Production 100 req/min 20 concurrent Unlimited
Enterprise Custom Custom Unlimited

Latency

  • Cold start — First request after deploy: ~2–3 seconds (embedding warmup)
  • Warm requests — Subsequent requests: <500ms p95
  • Embedding engine — Uses OpenAI text-embedding-3-small for vector matching

Rate limit headers. When rate limiting is enforced, responses include X-RateLimit-Limit, X-RateLimit-Remaining, and Retry-After headers. Implement exponential backoff in your client.

HIPAA Compliance

Rosetta Health is designed for HIPAA-compliant deployments. In production:

  • No PHI is logged or stored by default
  • All data in transit uses TLS 1.2+
  • BAA (Business Associate Agreement) available for enterprise plans
  • Search queries are not used for model training

Ready to integrate?

Get sandbox credentials and start building. We'll have you live in days, not months.

Request API Access