# Official Joke API on Onekey > 2 endpoints for Official Joke API (2 stable, 0 beta), 1 to 5 credits each. Category: Fun & utilities. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/officialjoke Reference (Markdown): https://onekey.dev/docs/api/officialjoke.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 2 mapped Official Joke API endpoints return each: - `content.id` (string): 2 - `entity.category` (string): 2 - plus 2 platform-specific fields under `ext.` ## Endpoints ### officialjoke.by_type A random joke of a type (general, knock-knock, programming, dad). - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/officialjoke/by_type?type=programming` with header `x-api-key: YOUR_API_KEY` - Parameters: - `type` (string, required): Joke type - Fields returned: `content.id`, `entity.category`, `ext.setup`, `ext.delivery` - Reference: https://onekey.dev/docs/api/officialjoke/by_type.md ### officialjoke.random A random joke (Official Joke API). - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/officialjoke/random` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id`, `entity.category`, `ext.setup`, `ext.delivery` - Reference: https://onekey.dev/docs/api/officialjoke/random.md ## Sample request ```bash curl "https://api.onekey.dev/v1/officialjoke/random" \ -H "x-api-key: YOUR_API_KEY" ```