phoenix-rest-api

Guides development and review of Phoenix REST API endpoints under the v1 router.

11.3k|1.1k|Updated Nov 9, 2022
One-click install
npx skills add https://github.com/Arize-ai/phoenix --skill phoenix-rest-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phoenix-rest-api
Source: https://github.com/Arize-ai/phoenix/tree/main/.agents/skills/phoenix-rest-api
Command: npx skills add https://github.com/Arize-ai/phoenix --skill phoenix-rest-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Adding or modifying REST endpoints in the Phoenix server requires following strict conventions for routing, models, auth, OpenAPI codegen, and integration test coverage, and missing any step causes CI failures.

Core Features & Use Cases

  • Endpoint Design Rules: Enforces RFC-compliant HTTP methods, plural noun paths, cursor-based pagination, and self-describing snake_case field names.
  • Codegen Workflow: Runs make openapi to regenerate the OpenAPI schema plus Python and TypeScript client types, which must all be committed together.
  • Testing Conventions: Directs integration test placement in tests/integration/ and registration of endpoints in _helpers.py coverage lists.
  • Use Case: When adding a new admin-only endpoint to src/phoenix/server/api/routers/v1/, follow the checklist to implement the route, regenerate client types, and register it in _ADMIN_ONLY_ENDPOINTS before committing.

Quick Start

Ask the assistant to add a new v1 REST endpoint to the Phoenix server following the phoenix-rest-api conventions and checklist.

Frequently Asked Questions about phoenix-rest-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new REST endpoint to the Phoenix server?

Add the route in src/phoenix/server/api/routers/v1/ using V1RoutesBaseModel response wrappers, register the router in create_v1_router(), then run make openapi and add the endpoint to the correct coverage list in tests/integration/_helpers.py.

What commands regenerate the OpenAPI schema and client types?

Run make openapi after any endpoint change. It regenerates schemas/openapi.json, the Python TypedDict client, and both TypeScript client files, all of which must be committed together to avoid CI drift failures.

How does pagination work in Phoenix v1 API endpoints?

Pagination is cursor-based only. Responses return a data array plus a next_cursor field, and filtering, sorting, and pagination parameters are passed as snake_case query parameters.

When should I use unit tests versus integration tests for endpoints?

Unit tests cover Pydantic validation and schema assertions in-process, while integration tests cover CRUD, auth, and cross-API verification against a real Phoenix subprocess. Any test hitting an HTTP endpoint belongs in integration.

Why does endpoint coverage validation fail in integration tests?

The _ensure_endpoint_coverage_is_exhaustive check normalizes paths, so use fake-id-{} for ID path params and test-tag for name params. Other placeholder values like fake-tag cause mismatches against the router.