Quickstart
Prerequisites
Section titled “Prerequisites”- An active Brookmimir account and a valid API key (64-character hexadecimal token).
- A command-line HTTP tool (curl, HTTPie) or the official Python SDK.
- Basic JSON familiarity.
- Confirm connectivity and API version.
- Inspect your credit balance.
- Run a safe search (
/query) or fetch a known document (/document). - Use
/face/searchonly after validating credits and payload sizing.
Verify service and version
Section titled “Verify service and version”Check the service quickly with /version (no credits consumed).
GET https://api.brookmimir.com/versionAccept: application/jsonExpected response:
{ "status": 200, "version": "1.3.0"}Use this call in CI or health checks to detect environment drift.
Inspect credits (always do this before billable calls)
Section titled “Inspect credits (always do this before billable calls)”The /credits endpoint returns your remaining balance and does not deduct credits.
GET https://api.brookmimir.com/creditsx-api-key: YOUR_64_CHAR_HEX_KEYAccept: application/jsonSuccessful response example:
{ "status": 200, "message": "Credits retrieved", "current_balance": 4287}If current_balance is 0, the API will return HTTP 402 for billable endpoints until credits are replenished.
Fetch a document (billable)
Section titled “Fetch a document (billable)”GET /document retrieves a canonical document by its Brookmimir identifier. This endpoint consumes one credit after header validation succeeds.
Headers required:
x-api-key— your 64-character tokenbmm-doc-id— the Brookmimir document identifier
GET https://api.brookmimir.com/documentx-api-key: YOUR_64_CHAR_HEX_KEYbmm-doc-id: DOC-123456Accept: application/jsonOn success you receive a document payload. On insufficient credits you will get HTTP 402; on a missing document you will get a StatusMessage describing the issue.
Run a search query (billable)
Section titled “Run a search query (billable)”POST /query accepts JSON search bodies. The call deducts one credit after validation.
Example request:
POST https://api.brookmimir.com/queryx-api-key: YOUR_64_CHAR_HEX_KEYContent-Type: application/jsonAccept: application/json
{ "query": "forensic accountant profile", "top_k": 5, "filters": { "jurisdiction": ["US"] }}A 200 response contains the search results. If credits are exhausted, expect HTTP 402.
Face search (billable, higher cost)
Section titled “Face search (billable, higher cost)”POST /face/search proxies biometric payloads to Brookmimir’s face search service and consumes one credit per validated request.
Supported payloads:
probe_image_b64— base64-encoded image (preferred when hosting images is not possible)probe_image_url— HTTPS image URLtop_k— optional result limit
Example:
POST https://api.brookmimir.com/face/searchx-api-key: YOUR_64_CHAR_HEX_KEYContent-Type: application/json
{ "probe_image_b64": "BASE64_STRING", "top_k": 3}Errors:
400for malformed payloads402for insufficient credits502for upstream failures from the biometric service
Lightweight connectivity probe
Section titled “Lightweight connectivity probe”Use /nettest or / as a fast pre-flight check from your infrastructure to verify network reachability before running workflows that might consume credits.
GET https://api.brookmimir.com/nettestAccept: application/jsonExamples: python SDK (recommended)
Section titled “Examples: python SDK (recommended)”Use the official Python SDK for thread-safe, validated requests and automatic header management.
Basic synchronous example:
from odins_eye import OdinsEyeClient, OdinsEyeAPIError
client = OdinsEyeClient( api_key="0123...abcd" # 64 hex characters)
# Check credits firstcredits = client.credits()if credits.get("current_balance", 0) == 0: raise SystemExit("No credits — refill before continuing")
# Searchtry: resp = client.query({"query": "forensic accountant profile", "top_k": 5}) documents = resp.get("resp", {}).get("body", {}).get("hits", {}).get("documents", []) for hit in documents: print(hit["doc_id"], hit.get("confidence"))except OdinsEyeAPIError as e: print("API error:", e.status_code, e.message)Async example:
from odins_eye import AsyncOdinsEyeClientimport asyncio
async def run(): async with AsyncOdinsEyeClient(api_key="0123...abcd") as client: credits = await client.credits() print("balance:", credits.get("current_balance"))
asyncio.run(run())Best practices
Section titled “Best practices”- Always call
/creditsbefore running billable endpoints (/document,/query,/face/search). - Keep API keys secret and rotate them regularly.
- Implement exponential backoff and a retry policy for transient 5xx/429 responses.
- Persist
bmm-doc-idvalues returned from searches to avoid repeated lookups. - Log request
statusandmessagefields to accelerate troubleshooting.
Troubleshooting Checklist
Section titled “Troubleshooting Checklist”- 400 responses: confirm headers and JSON validity.
- 402 responses: top up credits or gate operations behind balance checks.
- 404 responses: validate
bmm-doc-idand API key. - 5xx responses: retry with backoff and surface
request_idto support.
Where to go next
Section titled “Where to go next”- Read the Reference section for endpoint-specific schemas and example payloads.
- Use the Python SDK to handle retries, validation, and response parsing for you.
- Integrate
/nettestinto your monitoring runbooks as a pre-flight indicator.