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

# POST /v1/fix

> Stream an AI-generated fix for a security finding.

## Endpoint

```
POST /v1/fix
```

Returns a streaming `text/plain` response containing an AI-generated fix.

## Request

Same body structure as `/v1/explain`:

```json theme={null}
{
  "finding": { ... },
  "api_key": "sk-ant-optional-override"
}
```

See [POST /v1/explain](https:// zenveil.dev/docs/api-reference/explain.md) for the full `FindingSchema`.

## Response

Streaming `text/plain` — a structured fix suggestion including code diffs, migration steps, and context.

## Examples

```python Python theme={null}
import httpx

with httpx.stream(
    "POST",
    "https://api.zenveil.dev/v1/fix",
    headers={"X-API-Key": "zvk_live_your_key"},
    json={"finding": finding},
) as response:
    for chunk in response.iter_text():
        print(chunk, end="", flush=True)
```

```javascript JavaScript theme={null}
const response = await fetch('https://api.zenveil.dev/v1/fix', {
  method: 'POST',
  headers: {
    'X-API-Key': 'zvk_live_your_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ finding }),
});

const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  process.stdout.write(decoder.decode(value));
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.