Skip to main content

Monitoring API usage

Track error rates

Review the Status column regularly to identify spikes in 4xx or 5xx responses. Common patterns to watch for:
PatternWhat it may indicate
Sudden spike in 401 responsesAn API key may be invalid, expired, or revoked
Repeated 403 from one keyKey scope does not match the requested endpoint
Burst of 429 responsesRate limiting or retry pressure
Increasing 500 responsesServer-side issue. Check BabySea Status

Monitor by API key

Use the search bar to filter logs by a specific key name or prefix. This helps you:
  • Verify a new key is working correctly after creation.
  • Confirm a rotated key is receiving traffic.
  • Identify which key is generating errors.

Check key status icons

The key status icon in the API column gives you immediate visibility:
IconAction needed
KeyNo action. Key is active and healthy
RotateVerify the replacement key is working. The old key’s logs may still appear
ClockKey has expired. Replace the key in your application
SignalKey is revoked. Check if this was intentional

Debugging failed requests

When a request fails, the log entry includes both an HTTP status code and a BabySea error code. Use both to diagnose the issue:
1

Find the failed request

Search the logs table by error code (e.g. BSE4006) or status code (e.g. 401).
2

Check the error code

BabySea error codes indicate the specific failure reason. See SDK Errors for the full list with descriptions and resolutions.
3

Check the API key status

Look at the key status icon. If the key is expired or revoked, that explains authentication failures.
4

Check the endpoint

Verify the endpoint path is correct and that the key’s scope grants access to it. See Scopes for the full endpoint mapping.
5

Check the IP hash

If the key has an IP allowlist configured, compare the IP hash in the log with the expected source. Mismatched IPs result in 403 errors. See IP allowlist.

Common error codes in logs

Error codeStatusDescription
BSE1001401Missing API key
BSE1002401Invalid or expired API key
BSE1003403API key does not have permission for this resource
BSE1004402Insufficient credits
BSE1007403This IP address is not in the allowlist for this API key
The Error code column can also surface other BabySea error codes depending on the route and failure type.

Security

Regular log review

Establish a routine to review your request logs, especially for:
Review targetWhat to look for
Unauthorized access401 or 403 errors from unexpected IP hashes
Unusual endpointsRequests to endpoints your application should not use
Off-hours activityRequests at times when your application should be idle
Unknown key namesLog entries from keys you do not recognize

IP hash correlation

While raw IPs are not stored, you can use the hashed value to correlate requests:
TypeScript
import { createHash } from 'crypto';

// Hash a known IP to compare with log entries
const knownIp = '203.0.113.10';
const hash = createHash('sha256').update(knownIp).digest('hex');
const prefix = hash.substring(0, 12);

// Compare with the ip_hash column in your exported logs
console.log(`Look for entries starting with: ${prefix}`);
This lets you compare a known IP against exported log data without BabySea storing the raw address.

Export for compliance

If your organization requires long-term log retention beyond your plan’s retention period:
1

Set a regular export schedule

Export logs weekly or monthly before they age out of your retention window.
2

Use download (not clipboard)

Click Export as JSON or Export as CSV for reliable file exports. Clipboard operations may truncate large datasets.
3

Store securely

Save exported logs in a secure, access-controlled location. Log data may contain sensitive API key prefixes and endpoint patterns.

Retention awareness

Know your retention window

PlanRetentionExport frequency recommendation
Free1 dayDaily
Starter7 daysWeekly
Pro30 daysMonthly
Scale180 daysQuarterly
Enterprise1 yearQuarterly

Before deleting API keys

Always export logs before deleting an API key. Key deletion permanently removes all associated log entries via cascade. See Export for the step-by-step workflow.