Headers
Request and response headers of the Morphogen API.
Request
| Header | Where | Value |
|---|---|---|
Authorization | all endpoints | Bearer <key> |
x-api-key | all endpoints | the key without a prefix. The Anthropic SDK sends it. One of the two headers is enough |
anthropic-version | /v1/messages | 2023-06-01. The Anthropic SDK adds it itself |
Content-Type | requests with a body | application/json; for speech multipart/form-data, for video multipart is also allowed |
X-PII-Masking | /v1/chat/completions, /v1/messages, /v1/responses | on or off (also true, false, 1, 0). Turns PII masking in the request on or off |
X-Morphogen-Space | all endpoints that spend money | spc_…. Assigns the spending to a space |
If X-PII-Masking is not sent, the organization setting applies, and without the option enabled there is no masking. More: PII masking.
Response
| Header | Where | Value |
|---|---|---|
X-Request-Id | all responses | the request identifier. The service issues it, and a value from the request is not accepted. For POST /v1/videos it is the job identifier video_… |
X-PII-Masking | endpoints with masking | applied if masking was applied, off otherwise. Also present in responses with a provider error |
Retry-After | 429, some 5xx | the pause before a retry, in seconds |
Content-Type | all responses | application/json; for a stream text/event-stream; for a video file video/mp4 |
Example
curl -s https://api.morphogen.ru/v1/chat/completions \
-H "Authorization: Bearer $MORPHOGEN_API_KEY" \
-H "X-PII-Masking: on" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-6-luna", "max_tokens": 50, "messages": [{"role": "user", "content": "Меня зовут Иван Иванов"}]}' \
-D - -o /dev/null | grep -i -E "x-pii-masking|x-request-id"X-Pii-Masking: applied
X-Request-Id: gen-1760104212-Kd3vQ8mZ