API Key Guide
Overview
This guide explains how to obtain and use a DeepMark API key to authenticate your requests.
Authentication Header
All API calls must include:
X-Client-Api-Key: <your-api-key>Base URL
https://<your-deepmark-domain>Getting an API Key
Generate your API key from the DeepMark Web App → API Key page.
- The key is shown only once when generated or regenerated.
- Regenerating a key immediately invalidates the previous key.
- Store the key securely and never expose it publicly.
Discover Allowed Models
Endpoint
GET /client/modelsExample: List all models
curl -sS "https://<your-deepmark-domain>/client/models" \
-H "X-Client-Api-Key: <your-api-key>"Example: Filter by model name
curl -sS "https://<your-deepmark-domain>/client/models?name=<model-name>" \
-H "X-Client-Api-Key: <your-api-key>"Example Response
[
{
"_id": "67f123...",
"name": "model-a",
"version": "1.0.0",
"type": "video",
"is_default": true,
"description": "...",
"max_watermark_length": 256,
"min_watermark_length": 32,
"default_watermarks": []
}
] Use the name and version from this response when calling embed or detect.
Submit Embed Job
Endpoint
POST /client/embed
Content-Type: multipart/form-dataRequired Fields
| Field | Description |
|---|---|
file | Media file (audio or video, depending on model) |
watermark | Binary string containing only 0 and 1 |
model | Model ID (from /client/models) |
Example Request
curl -sS -X POST "https://<your-deepmark-domain>/client/embed" \
-H "X-Client-Api-Key: <your-api-key>" \
-F "file=@/path/to/input.file" \
-F "watermark=10101010" \
-F "model=model-id"Example Response
{
"job_id": "2d6a6f2f-....",
"status": "started"
}Submit Detection Job
Endpoint
POST /client/detect
Content-Type: multipart/form-dataRequired Fields
| Field | Description |
|---|---|
file | Watermarked media file |
model | Model ID (from /client/models) |
Example Request
curl -sS -X POST "https://<your-deepmark-domain>/client/detect" \
-H "X-Client-Api-Key: <your-api-key>" \
-F "file=@/path/to/input.file" \
-F "model=model-id"Example Response
{
"job_id": "c0ab4f4f-....",
"status": "started"
}Download Job Result (Recommended: Presigned URL)
Endpoint
GET /client/inference-jobs/{job_id}/download?presign=1&disposition=attachmentExample: Request Presigned URL
curl -sS "https://<your-deepmark-domain>/client/inference-jobs/<job_id>/download?presign=1&disposition=attachment" \
-H "X-Client-Api-Key: <your-api-key>"Example Response
{
"url": "https://s3...."
}Download Using Presigned URL
curl -L "<presigned-url>" -o result.outNotes
- Presigned URLs are time-limited and short-lived
- Use
disposition=inlinefor browser or media playback behavior
Polling Pattern
Job processing is asynchronous.
Recommended flow
- Submit job (embed or detect) and store the
job ID - Poll:
GET /client/inference-jobs/{job_id}/download?presign=1 - If the job is not ready, API returns:
400 Result not available yet - Retry after a few seconds until the result becomes available.
Common Errors
| Status Code | Meaning |
|---|---|
| 400 | Validation issue (invalid watermark, unknown model/version, or job not completed yet) |
| 401 | Invalid or missing X-Client-Api-Key |
| 403 | Key is valid but not authorized for the requested model/job |
| 404 | Job not found |
| 500 | Server-side failure |
Security Best Practices
- Never expose API keys in frontend or public code
- Store keys in a secrets manager or backend environment variables
- Rotate keys regularly
- After regeneration, update all integrations immediately
