# 24K Labs Color Converter

> 24K Labs Color Converter is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Converts a color between hex, RGB, HSL, HSV, and CMYK formats, and optionally computes the WCAG 2.1 contrast ratio and AA/AAA accessibility compliance against a second color.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/color-convert
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/24k-labs-color-converter-53727e55
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_72GCRzwehQgVcWSJgoYRy

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 24k-labs-color-converter-53727e55 -d '<json body>'
```

Example prompt: Convert #3A86FF to RGB, HSL, HSV, and CMYK, and also check if it passes WCAG AA and AAA contrast against white (#FFFFFF).

## When to prefer this

Choose this endpoint when you need to translate a color across multiple color spaces in a single call, especially when you also want to check accessibility compliance (WCAG) against a second color simultaneously. It is more efficient than calling separate conversion and contrast endpoints. Prefer this over the sibling WCAG-only endpoint when you need the color format conversions as well as accessibility data.

## Known failure modes

- Invalid color value format returns a 400 error
- Unsupported color space input returns a parsing error
- Malformed hex string (wrong length or invalid characters) causes a validation failure
- Missing required color input field returns a missing parameter error

## How this service works

Convert a color across hex/rgb/hsl/hsv/cmyk and (optionally) compute the WCAG contrast ratio and AA/AAA pass against a second color.

## Output

Returns the input color expressed in all five formats (hex, RGB, HSL, HSV, CMYK). If a second color is provided, also returns the WCAG 2.1 contrast ratio as a numeric value and boolean pass/fail flags for AA (4.5:1) and AAA (7:1) thresholds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "color": {
   "type": "string"
  },
  "against": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "hex": "#3366cc",
  "rgb": [
   51,
   102,
   204
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/24k-labs-color-converter-53727e55/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
