YepAPI
Getting Started

Errors

Standard error codes and how to handle them.

Error Format

All errors follow the same format:

{
  "ok": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable description"
  }
}

Error Codes

CodeHTTP StatusDescription
INVALID_API_KEY401Missing or invalid API key
REVOKED_API_KEY401API key has been revoked
NO_CREDITS402Insufficient balance for this request
VALIDATION_ERROR400Request body validation failed
NOT_FOUND404Endpoint or resource not found
JOB_NOT_FOUND404Media job not found
JOB_EXPIRED410Job result has expired, resubmit your request
MEDIA_MODEL_NOT_FOUND400Unknown media model ID
UPSTREAM_ERROR502Upstream provider returned an error
AI_UPSTREAM_ERROR502AI provider returned an error
INTERNAL_ERROR500Something went wrong on our end

Handling Errors

const res = await fetch('https://api.yepapi.com/v1/seo/keywords', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ keywords: ['nextjs seo'] }),
});

const result = await res.json();

if (!result.ok) {
  const { code, message } = result.error;

  if (code === 'NO_CREDITS') {
    // Add funds at https://yepapi.com/dashboard/billing
  }
}

Request IDs

Every response carries an x-request-id header and a top-level request_id field in the JSON body:

{
  "ok": false,
  "request_id": "3f1c9e2a-7b4d-4e8f-9a21-0c5d6e7f8a9b",
  "error": {
    "code": "UPSTREAM_ERROR",
    "message": "Upstream data source returned an error"
  }
}

You can look up any data API call — including failed ones (4xx/5xx, and 504 Gateway Timeout, shown with status 504) — under Dashboard → API Logs. It lists the request ID, endpoint, status code, cost and latency for your latest 100 data API calls. Failed calls are never charged.

Include the request ID when contacting support so we can find the exact call.

Upstream Errors

When an upstream data source returns an error, we return an UPSTREAM_ERROR with additional context:

{
  "ok": false,
  "error": {
    "code": "UPSTREAM_ERROR",
    "message": "Upstream data source returned an error",
    "upstream": {
      "status": 500,
      "message": "Internal server error"
    }
  }
}

On this page