Skip to content

Instantly share code, notes, and snippets.

@misaelvillaverde
Last active February 12, 2026 17:39
Show Gist options
  • Select an option

  • Save misaelvillaverde/7eb88f9ec417beba941967dbb15db386 to your computer and use it in GitHub Desktop.

Select an option

Save misaelvillaverde/7eb88f9ec417beba941967dbb15db386 to your computer and use it in GitHub Desktop.
Pixel Canvas - Fase 1: Endpoints Base

Pixel Canvas - Fase 1: Endpoints Base

Tu API key se obtiene en la pagina de asientos: https://pixels.misael.software/seats

Todas las llamadas autenticadas requieren el header:

Authorization: Bearer TU-API-KEY

Base URL: https://pixels.misael.software


GET /api/me

Tu info como jugador.

curl -H "Authorization: Bearer PXL-XXXX-XXXX" https://pixels.misael.software/api/me
{
  "name": "tu-nombre",
  "total_pixels_placed": 5,
  "pixels_on_board": 3,
  "cooldown_remaining_seconds": 0
}

POST /api/pixel

Coloca un pixel. Cooldown de 10 segundos entre cada colocacion.

  • x: 0-127
  • y: 0-127
  • color: hex (#FF0000) o nombre (red, blue, green, yellow, white, black, purple, orange, pink, cyan)
curl -X POST https://pixels.misael.software/api/pixel \
  -H "Authorization: Bearer PXL-XXXX-XXXX" \
  -H "Content-Type: application/json" \
  -d '{"x": 64, "y": 64, "color": "#FF0000"}'
{
  "success": true,
  "pixel": {
    "color": "#FF0000",
    "player": "tu-nombre",
    "placed_at": "2026-02-12T18:30:00.000Z"
  },
  "cooldown_seconds": 10
}

Si intentas colocar antes del cooldown:

{
  "error": "Rate limited",
  "retry_after_seconds": 7
}

GET /api/canvas

El canvas completo (128x128). Retorna un array de 16,384 pixeles (row-major: indice = y * 128 + x). Los pixeles vacios son null.

curl https://pixels.misael.software/api/canvas
{
  "width": 128,
  "height": 128,
  "pixels": [
    null,
    null,
    { "color": "#FF0000", "player": "jugador1", "placed_at": "2026-02-12T18:30:00.000Z" },
    "..."
  ],
  "total_placements": 42,
  "phase": 1
}

GET /api/canvas/area

Una seccion del canvas alrededor de un punto central.

  • x, y: centro (0-127)
  • radius: radio (1-64)
curl "https://pixels.misael.software/api/canvas/area?x=64&y=64&radius=5"
{
  "x": 64,
  "y": 64,
  "radius": 5,
  "pixels": [
    { "x": 62, "y": 63, "color": "#FF0000", "player": "jugador1" },
    { "x": 64, "y": 64, "color": "#00FF00", "player": "jugador2" }
  ]
}

Tools MCP a implementar

Tool Descripcion
get_my_info Llama GET /api/me
place_pixel Llama POST /api/pixel con x, y, color
get_canvas Llama GET /api/canvas
get_area Llama GET /api/canvas/area con x, y, radius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment