Design the trust boundary
Keep API keys out of browsers and mobile bundles; authenticate your own users and proxy approved requests through your backend.
✦ Guide · Intermediate
Design the server boundary, permissions, reliability controls, observability, cost safeguards, and versioning workflow around Oppermind’s API.
Start guideYOUR OUTCOME
Keep API keys out of browsers and mobile bundles; authenticate your own users and proxy approved requests through your backend.
Use separate named keys for development, staging, and production with minimal permissions, optional IP allowlists, and planned rotation.
Send a unique Idempotency-Key on every POST and reuse it only for the same logical operation within the 24-hour replay window.
Treat authentication, permission, billing, validation, conflict, rate, and gateway errors differently instead of retrying everything.
Log X-Request-ID, X-API-Version, route type, latency, usage, and safe error codes; monitor credits, alerts, and webhook events.
Use the authenticated OpenAPI specification and changelog in CI, watch Deprecation and Sunset headers, and plan migrations within the announced runway.
What each lesson covers
Keep API keys out of browsers and mobile bundles; authenticate your own users and proxy approved requests through your backend.
Write down the route your caption feature will use: the mobile app calls your own backend at /api/caption with the user's session token; your backend checks that user's plan and quota, then calls https://oppermind.com/api/v1/messages with the opmd_sk_… key read from a server secret. The key never leaves the server.
Use separate named keys for development, staging, and production with minimal permissions, optional IP allowlists, and planned rotation.
In the Developer console create three keys named summariser-dev, summariser-staging and summariser-prod, each with the text only permission. Add your production servers' egress IPs to the prod key's IP allowlist and set a rotation date for all three.
Send a unique Idempotency-Key on every POST and reuse it only for the same logical operation within the 24-hour replay window.
For each product-description job, generate one UUID when the job is created and send it on the POST to /messages as Idempotency-Key: 9b2f7c1e-4a6d-4e0b-9c1a-3d5e7f8a9b0c On a timeout or 5xx, retry with the same key; start a new job with a new key.
Treat authentication, permission, billing, validation, conflict, rate, and gateway errors differently instead of retrying everything.
In your support-bot backend, switch on error.type and error.code from the JSON body: authentication_error and permission_error page an engineer; billing_error disables generation and alerts finance; invalid_request gets fixed, not retried; idempotency_conflict waits and reuses the key; rate_limit_error backs off using the RateLimit headers; api_error retries a bounded number of times.
Log X-Request-ID, X-API-Version, route type, latency, usage, and safe error codes; monitor credits, alerts, and webhook events.
For every call from the design-marketplace image feature, write one structured log line: X-Request-ID, X-API-Version, endpoint, latency in ms, usage token counts for text calls, image count for /images, and error.code when present. In the Developer console set a credit alert at the level where you would pause the feature and monitor the webhook events.
Use the authenticated OpenAPI specification and changelog in CI, watch Deprecation and Sunset headers, and plan migrations within the announced runway.
Add a CI step that fetches GET https://oppermind.com/api/v1/openapi.json and GET https://oppermind.com/api/v1/changelog with the staging key, regenerates your client types from the spec, and fails the build if the types change or a Deprecation header appears on any endpoint the listing-video feature uses.
Keep going
Make the learning stick
Open Oppermind beside the lesson, apply each step, and leave with something you can use.