Create a Glyph
Create a new glyph in the marketplace.
Endpoint
POST /glyphAuthentication
Required. Bearer token in Authorization header.
Request
Headers
Authorization: Bearer YOUR_TOKEN
Content-Type: application/jsonBody
{
"slug": "my-new-glyph",
"type": "prompt",
"category": "launch",
"name": "My New Glyph",
"description": "A short description of what this glyph does",
"longDescription": "A longer, more detailed description...",
"tags": ["tag1", "tag2"],
"coverImage": "https://...",
"codeSnippet": "const result = await run(input)",
"codeLanguage": "javascript",
"inputSchema": [
{
"name": "fieldName",
"label": "Field Label",
"type": "text",
"required": true,
"placeholder": "Enter value..."
}
],
"outputSchema": {
"type": "markdown"
},
"promptConfig": {
"promptTemplate": "Your prompt template with {{variables}}",
"systemPrompt": "Optional system prompt",
"allowedModels": ["gpt-4o", "claude-3.5-sonnet"],
"defaultModelId": "gpt-4o",
"sourcePrice": 4.99,
"examples": []
}
}Required Fields
| Field | Type | Description |
|---|---|---|
slug | string | Unique URL-friendly identifier |
type | string | prompt, agent, or tool |
category | string | launch, secure, or optimize |
name | string | Display name |
description | string | Short description |
inputSchema | array | Input field definitions |
Optional Fields
| Field | Type | Description |
|---|---|---|
longDescription | string | Detailed description |
tags | array | Discovery tags |
coverImage | string | Cover image URL |
codeSnippet | string | Example code |
codeLanguage | string | Code language |
outputSchema | object | Output format definition |
Type-Specific Config
For Prompts
{
"promptConfig": {
"promptTemplate": "Template with {{variables}}",
"systemPrompt": "System context",
"allowedModels": ["gpt-4o", "claude-3.5-sonnet"],
"defaultModelId": "gpt-4o",
"sourcePrice": 4.99,
"examples": [
{
"title": "Example 1",
"inputs": {"field": "value"},
"output": "Example output",
"model": "gpt-4o"
}
]
}
}For Agents
{
"agentConfig": {
"webhookUrl": "https://your-webhook.com/endpoint",
"webhookMethod": "POST",
"webhookHeaders": {"X-Custom": "value"},
"timeoutSeconds": 60,
"maxRetries": 3,
"pollUrl": "https://your-webhook.com/poll",
"pollIntervalMs": 2000,
"basePrice": 0.10
}
}For Tools
{
"toolConfig": {
"apiEndpoint": "https://api.example.com/endpoint",
"apiMethod": "GET",
"apiHeaders": {},
"authType": "api_key",
"authConfig": {"headerName": "X-API-Key"},
"requestTransform": "...",
"responseTransform": "...",
"rateLimitPerMinute": 60,
"basePrice": 0.05
}
}Response
Success (201)
{
"created": true,
"glyph": {
"id": "glyph_abc123",
"slug": "my-new-glyph",
"type": "prompt",
"category": "launch",
"status": "draft"
}
}Error Responses
Validation Error (400)
{
"error": "Validation failed",
"details": {
"slug": "Slug already exists",
"inputSchema": "At least one input field required"
}
}Unauthorized (401)
{
"error": "Authentication required"
}Examples
Create a Prompt Glyph
curl -X POST https://api.glyphrun.com/glyph \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "contract-analyzer",
"type": "prompt",
"category": "secure",
"name": "Smart Contract Analyzer",
"description": "Analyze smart contracts for vulnerabilities",
"inputSchema": [
{
"name": "contractAddress",
"label": "Contract Address",
"type": "text",
"required": true
}
],
"promptConfig": {
"promptTemplate": "Analyze the contract at {{contractAddress}}...",
"allowedModels": ["gpt-4o", "claude-3.5-sonnet"],
"defaultModelId": "gpt-4o"
}
}'Code Examples
JavaScript
const response = await fetch('https://api.glyphrun.com/glyph', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
slug: 'my-glyph',
type: 'prompt',
category: 'launch',
name: 'My Glyph',
description: 'Description here',
inputSchema: [
{ name: 'input1', label: 'Input 1', type: 'text', required: true }
],
promptConfig: {
promptTemplate: 'Process: {{input1}}',
allowedModels: ['gpt-4o'],
defaultModelId: 'gpt-4o'
}
})
})
const { glyph } = await response.json()
console.log(`Created: ${glyph.id}`)Notes
- Glyphs are created in draft status
- Publish via the Creator Dashboard
- Slugs must be unique
- Input schema is validated
Last updated on: