> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rcintell.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Code research

> Submit billing code research queries with CPT/HCPCS/ICD-10 context

The code research agent helps you find the correct billing codes, understand documentation requirements, and identify common modifiers for procedures.

## Submit a query

```bash theme={null}
curl -X POST https://api-dev.rcintell.com/v1/agents/code-research \
  -H "X-API-Key: kp_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What is the correct CPT for a total knee replacement?",
    "ccn": "170001",
    "cpt_code": "27447"
  }'
```

### Request body

| Field        | Type   | Required | Description                           |
| ------------ | ------ | -------- | ------------------------------------- |
| `query`      | string | Yes      | The code research question            |
| `cpt_code`   | string | No       | Specific CPT code to research         |
| `hcpcs_code` | string | No       | Specific HCPCS code to research       |
| `ccn`        | string | No       | Facility CCN for knowledge enrichment |
| `context`    | object | No       | Additional key-value context          |

### Response

```json theme={null}
{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending",
  "agent_type": "code_research",
  "created_at": "2026-03-11T10:00:00Z"
}
```

## Poll for results

```bash theme={null}
curl https://api-dev.rcintell.com/v1/agents/jobs/{job_id} \
  -H "X-API-Key: kp_test_..."
```

When complete:

```json theme={null}
{
  "job_id": "550e8400-...",
  "status": "completed",
  "agent_type": "code_research",
  "result": {
    "codes": [
      {
        "code": "27447",
        "type": "CPT",
        "description": "Arthroplasty, knee, condyle and plateau; medial AND lateral compartments",
        "work_rvu": 20.72,
        "documentation_requirements": [
          "Operative report with detailed findings",
          "Pre-operative diagnosis supporting medical necessity",
          "Conservative treatment failure documentation"
        ],
        "common_modifiers": ["LT", "RT"],
        "common_dx": ["M17.11", "M17.12"]
      }
    ],
    "guidance": "CPT 27447 is the correct code for a total knee arthroplasty..."
  },
  "audit_tier": "green",
  "composite_score": 0.94,
  "security_score": 1.0
}
```

## Get reasoning trace

```bash theme={null}
curl https://api-dev.rcintell.com/v1/agents/jobs/{job_id}/trace \
  -H "X-API-Key: kp_test_..."
```

Returns the agent's step-by-step reasoning.

## Common use cases

* "What CPT code should I use for a laparoscopic cholecystectomy?"
* "What are the documentation requirements for E/M level 4?"
* "Can I bill 99213 and 99215 together?"
* "What modifier do I need for bilateral knee injections?"
* "What is the difference between CPT 27447 and 27446?"
