Codex Pet Spritesheet Specification
The exact spritesheet grid, nine animation states, and pet.json contract for building a pixel companion that runs inside OpenAI Codex.
Overview
A Codex pet is two files that live in your ~/.codex/pets/ folder: a single transparent spritesheet image and a pet.json metadata file. Codex reads the folder at startup, slices the spritesheet into frames by a fixed grid, and plays the matching animation as your coding companion.
Spritesheet Layout
The spritesheet is one 1536×1872 px transparent image laid out as an 8-column by 9-row grid. Each of the 72 cells is a single animation frame measuring 192×208 px. Rows map top-to-bottom to the nine animation states; columns are the frames within each state.
Columns → frames 1–8 · Rows → animation states (top to bottom).
Animation States
Nine animation states make up the spritesheet, one per row. The frame count below is the source of truth that <code>pet.json</code> and the generator must agree on.
| # | Key | Label | Frames |
|---|---|---|---|
| 1 | idle | Idle | 6 |
| 2 | running-right | Run Right | 8 |
| 3 | running-left | Run Left | 8 |
| 4 | waving | Waving | 4 |
| 5 | jumping | Jumping | 5 |
| 6 | failed | Failed | 8 |
| 7 | waiting | Waiting | 6 |
| 8 | running | Running | 6 |
| 9 | review | Review | 6 |
pet.json
Place a <code>pet.json</code> next to the spritesheet. It carries four fields:
1{2 "id": "pet_abc123",3 "displayName": "Pixel Companion",4 "description": "A cheerful pixel-art pet for OpenAI Codex.",5 "spritesheetPath": "spritesheet.webp"6}idA stable unique identifier for the pet (used for caching and future updates).displayNameThe human-readable name shown in Codex and the pet picker.descriptionA short sentence describing the pet, shown as a tooltip or in listings.spritesheetPathPath to the spritesheet image, relative to pet.json (usually spritesheet.webp).
Install
Extract the downloaded ZIP, then copy the pet folder into your Codex pets directory and fully restart Codex.
1mkdir -p ~/.codex/pets/my-pixel-pet2unzip -o my-pixel-pet.zip -d ~/.codex/pets/my-pixel-pet1New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex\pets\my-pixel-pet"2Expand-Archive -Path "my-pixel-pet.zip" -DestinationPath "$env:USERPROFILE\.codex\pets\my-pixel-pet" -ForceValidate
Before shipping a pet, confirm these three things:
- Spritesheet is exactly 1536 × 1872 px (8 columns × 9 rows, 192 × 208 px cells).
- All nine animation states are present and in the correct row order with their expected frame counts.
- pet.json defines all four fields: id, displayName, description, spritesheetPath.