Launch
On the launch wizard (and optionally My Agents draft edit), a connected creator can press Generate with Grok to produce a complete Agent identity suited to the selected template type, including a matching profile image. All xAI calls stay server-side; the browser never receives XAI_API_KEY.
- Phase A — Identity text via Responses API + structured JSON output. - Phase B — Avatar image(s) via Grok Imagine (/v1/images/generations or Responses image_generation tool), using an image prompt derived from Phase A and the template style pack.
Each template ships a code-owned style pack used in both phases:
| Template | Identity bias | Visual bias |
|---|---|---|
| Trading | market analyst persona, risk-aware language | terminal / chrome / neon market HUD portrait |
| Research | investigator, sources-first | archival / lens / data-ink portrait |
| DeFi | protocol-native, precise | circuit / vault / on-chain geometry |
| Content | editorial voice | cinematic creator portrait |
| Social | witty, conversational | social-native character art |
| Community | welcoming moderator | warm guild / hub aesthetic |
| Gaming | playful competitor | game-ready character sheet vibe |
| Utility | practical operator | clean tool/agent badge portrait |
| Custom | follow user seed heavily | industrial FORGE default look |
Style packs include: system instructions, banned clichés, ticker naming rules, and a fixed visual art direction string (FORGE industrial / charcoal / forge-orange accents — original art, not third-party IP).
Model: XAI_MODEL_DEFAULT (e.g. grok-4.7).
Server prompt layers (immutable order):
Required structured fields (Zod-validated):
{
name: string; // display name
ticker: string; // 3–8 alnum, no $
shortDescription: string; // <= 160 chars
personality: string; // backstory + voice, markdown-lite OK
tags: string[]; // 2–5 public capability tags
starterGreeting: string; // first chat line suggestion
avatarPrompt: string; // image model prompt, 1:1 portrait
capabilitySuggestions: string[]; // subset of template-allowed caps
}Creator prompts cannot expand tool permissions beyond the template allowlist; capabilitySuggestions is filtered server-side.
Preferred path for control: POST {XAI_BASE_URL}/v1/images/generations with:
XAI_IMAGE_MODEL=grok-imagine-image-2.0
XAI_IMAGE_ASPECT_RATIO=1:1
XAI_IMAGE_RESOLUTION=1k
XAI_IMAGE_QUALITY=auto
IDENTITY_AVATAR_VARIANTS=3Prompt assembly:
{template.visualDirection}
{identity.avatarPrompt}
Square 1:1 character portrait suitable as a crypto agent profile image.
No logos of other brands. No readable wallet addresses or QR codes.
No real-person likeness requests. High clarity face/character focal point.Generate IDENTITY_AVATAR_VARIANTS (default 3) candidates when budget allows; MVP may generate 1 and offer regenerate.
Alternate path: Responses API with tools: [{ type: "image_generation", action: "generate" }] after Phase A in the same conversation — acceptable if Imagine direct params are unavailable.
Persist selected image as avatar_url on the Agent draft after MIME sniff + size cap (e.g. 2 MB) + optional EXIF strip.
POST /api/v1/agents/identity/generate — wallet session required; body { template, seed?, agentId? }; returns job id or inline result for MVP.POST /api/v1/agents/:id/identity/generate — same, bound to draft agent.POST /api/v1/agents/:id/identity/regenerate-avatar — rerun Phase B only with current draft fields.POST /agents/:id/avatar remains for manual upload.SSE optional progress events: identity.start → identity.text → identity.image.start → identity.image.candidate → identity.completed / error.
IDENTITY_GEN_DAILY_LIMIT, IDENTITY_AVATAR_DAILY_LIMIT).agent_usage_daily + generation-specific counters).identity_generation_enabled; admin can disable without blocking chat.Launch wizard Step 1:
429 with retry hint.