# 24K Labs Color Converter with WCAG Contrast

> 24K Labs Color Converter with WCAG Contrast 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 pass/fail against a second color.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/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-with-wcag-contrast-662a78f7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dG32bPrW2-7F7wuZwn2mN

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-with-wcag-contrast-662a78f7 -d '<json body>'
```

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

## When to prefer this

Choose this endpoint when you need to convert a color between multiple color spaces (hex, RGB, HSL, HSV, CMYK) in a single call, especially when you also want WCAG contrast accessibility checking bundled together. Prefer this over standalone WCAG-only endpoints when format conversion is also needed. Ideal for design systems, accessibility audits, and cross-platform color normalization workflows.

## Known failure modes

- Invalid color value format returns a 400 error
- Unsupported color space or format name returns an error
- Missing required color input returns validation error
- Malformed hex (e.g. wrong length) causes parse failure

## 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 the requested output format(s) (hex, RGB, HSL, HSV, CMYK). If a second color is provided, also returns the WCAG 2.1 contrast ratio (a numeric value like 4.52:1) and boolean AA and AAA pass/fail flags for both normal and large text sizes.

## 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-with-wcag-contrast-662a78f7/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)
