Skip to Content
The App Store for AI Agents - Run, create, and monetize AI glyphs
API ReferenceRun a Glyph

Run a Glyph

Execute a glyph and receive the output.

Endpoint

POST /run

Authentication

Required. Bearer token in Authorization header.

Request

Headers

Authorization: Bearer YOUR_TOKEN Content-Type: application/json

Body

{ "glyphSlug": "token-name-generator", "inputs": { "theme": "DeFi", "style": "Professional" }, "modelId": "claude-3.5-sonnet" }

Parameters

FieldTypeRequiredDescription
glyphSlugstringYesGlyph identifier (slug or ID)
inputsobjectYesInput values matching glyph schema
modelIdstringNoModel ID for prompts (uses default if omitted)

Response

Success (200)

{ "success": true, "runId": "run_abc123", "output": "## Token Name Suggestions\n\n1. **VaultYield** - Combines security...", "cost": 0.05, "duration": 3500, "modelId": "claude-3.5-sonnet", "usage": { "prompt_tokens": 150, "completion_tokens": 250, "total_tokens": 400 } }

Response Fields

FieldTypeDescription
successbooleanWhether execution succeeded
runIdstringUnique run identifier
outputstringGlyph output (format varies by type)
costnumberAmount charged (USDC)
durationnumberExecution time (ms)
modelIdstringModel used (for prompts)
usageobjectToken usage (for prompts)

Error Responses

Insufficient Balance (402)

{ "error": "Insufficient balance", "required": 0.05, "available": 0.02, "runId": "run_abc123" }

Glyph Not Found (404)

{ "error": "Glyph not found: invalid-slug", "runId": "run_abc123" }

Invalid Input (400)

{ "error": "Invalid input", "details": { "theme": "Required field missing" }, "runId": "run_abc123" }

Execution Error (500)

{ "error": "Execution failed: LLM timeout", "runId": "run_abc123" }

Examples

Run a Prompt Glyph

curl -X POST https://api.glyphrun.com/run \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "glyphSlug": "smart-contract-analyzer", "inputs": { "contractAddress": "0x1234567890abcdef1234567890abcdef12345678", "network": "base", "depth": "detailed" }, "modelId": "gpt-4o" }'

Run an Agent Glyph

curl -X POST https://api.glyphrun.com/run \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "glyphSlug": "wallet-monitor", "inputs": { "walletAddress": "0x1234...", "alertThreshold": 1000 } }'

Run a Tool Glyph

curl -X POST https://api.glyphrun.com/run \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "glyphSlug": "contract-source-lookup", "inputs": { "address": "0x1234...", "network": "ethereum" } }'

Code Examples

JavaScript

const response = await fetch('https://api.glyphrun.com/run', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ glyphSlug: 'token-name-generator', inputs: { theme: 'DeFi', style: 'Professional' } }) }) const result = await response.json() console.log(result.output)

Python

import requests response = requests.post( 'https://api.glyphrun.com/run', headers={ 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' }, json={ 'glyphSlug': 'token-name-generator', 'inputs': { 'theme': 'DeFi', 'style': 'Professional' } } ) result = response.json() print(result['output'])

Notes

  • Failed runs are not charged
  • Runs are logged in your history
  • Cost is deducted from available balance
  • Long-running agents may take up to 180 seconds
Last updated on: