# GlianaAI Code-Image Tool

> GlianaAI Code-Image Tool is a paid API for AI agents from api.glianalabs.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Generates or retrieves a code-related image via GlianaAI's pay-per-call inference platform, settled in USDC with no API key required.

## Facts

- Endpoint: GET https://api.glianalabs.com/x402/tools/code-image
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/glianaai-code-image-tool-8702e0be
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mqo3Ucyws5OMj_ogaQ2nH

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 glianaai-code-image-tool-8702e0be
```

Example prompt: Can you turn this Python snippet into a clean, shareable code image using GlianaAI? I'll pay $0.02 USDC per call — no API key needed, just settle via x402.

## When to prefer this

Choose this endpoint when you need to generate a visual image from code content without managing API keys or subscriptions, and when your agent can settle micropayments in USDC via x402 protocol on Base, Tempo, or Solana.

## Known failure modes

- Missing required 'input' field returns validation error
- Invalid 'method' value (must be GET) causes rejection
- Malformed body or unsupported bodyType enum causes parse error
- Insufficient USDC balance or failed x402 payment results in 402 Payment Required
- Network timeout on inference backend returns 5xx error

## How this service works

GlianaAI - pay-per-call AI models, live market data and identity APIs (90+ models incl. LLM chat), no signup, USDC. This resource: tools/code-image. Render a syntax-highlighted code snippet as an image. Use when an agent shares code somewhere that cannot display a code block. Inputs: code (required), title (filename shown in the window bar), language (for highlighting, e.g. ts, py). Returns url and contentType of the PNG. https://ai.glianalabs.com

## Output

Returns a JSON response confirming the tool used (tools/code-image) along with the generated image output, such as a rendered or styled visual representation of code content.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "tool": "tools/code-image"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/glianaai-code-image-tool-8702e0be/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.glianalabs.com](https://www.zero.xyz/host/api.glianalabs.com/llms.txt)
