> For the complete documentation index, see [llms.txt](https://docs.medicare.healthsherpa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.medicare.healthsherpa.com/api-reference/version-1-api-keys/authentication/api-keys.md).

# API Keys

## Using Your API Key

Include your API key in the `X-API-Key` header with every request:

```http
X-API-Key: your_api_key_here
```

Example using cURL:

```bash
curl -X POST https://api.medicare.healthsherpa.com/v1/contacts \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"first_name": "Alex", "last_name": "Lee", ...}'
```

## API Key Management Best Practices

1. **Secure Storage**
   * Store API keys in environment variables or secure secret management systems
   * Never commit API keys to version control
   * Rotate keys immediately if they are accidentally exposed
2. **Access Control**
   * Limit access to API keys to only necessary personnel
   * Use different API keys for different environments (test vs production)
3. **Implementation**
   * Use HTTPS for API requests
   * Don't log API keys in error messages

## Troubleshooting

If you receive a `401 Unauthorized` response:

1. Verify the API key is correctly formatted
2. Confirm you're using the correct key for your environment
3. Contact support if issues persist


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.medicare.healthsherpa.com/api-reference/version-1-api-keys/authentication/api-keys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
