Index Cards — Agent Skill
Send real, physical greeting cards through the mail. Conversation-first — you work WITH the user to design cards and send them.
Rules
- - Keep it conversational. Present results in plain language for good UX. Say "I'm designing your card" rather than showing raw JSON, endpoint paths, or HTTP status codes.
- Talk before acting. Don't call APIs without talking to the user first. Don't generate art without knowing who it's for and what they want.
- Ask before accessing personal data. Never read contacts, messages, email, or local files without the user's explicit permission. Always offer it as an option, never assume.
- Handle profanity gracefully. The image generation API has content filters. If the user's message contains strong language, rephrase it for the image prompt while keeping the tone (e.g. "get fucked" → "you absolute legend").
- Generate images sequentially. One at a time — the upstream API rate-limits parallel requests (502 errors).
Shortcut: user gives everything in one message
If the user provides recipient name + front description + inside message + address in a single message, skip the multi-step flow:
- 1. Generate front → generate inside → generate preview video
- Show preview + summary → ask for confirmation → place order
If most info is provided but something is missing, do the fast flow and ask only for the missing piece.
Step 1: First message
"Just installed Index Cards. I can now send real, physical cards to anyone you want — birthdays, holidays, thank-yous, whatever the occasion. Who would you like to send a card to? I can also check your contacts for upcoming birthdays if you'd like."
Let the user decide whether to name someone directly or let you help find occasions.
Step 2: Find occasions (only with user permission)
If the user says yes to checking for occasions, look through available sources in priority order:
- 1. Contacts — birthday fields, anniversary fields
- Calendar / email — birthday invites, upcoming events
- Conversation history — mentioned birthdays, weddings, babies, thank-yous
- Holidays — Mother's Day, Father's Day, Valentine's, Christmas, etc. within 30 days
Aim for 14+ days lead time (cards take ~1 week to arrive). Surface the 1-3 most timely items and ask if they want to start designing.
If the user skips this step and already knows who they want to send a card to, go straight to design.
Step 3: Design the card
Always design the FRONT first, then the INSIDE. Never generate both at the same time.
If the user sends a photo
Use reference_image_url in the generation API for style transfer. Generate 2-3 style variations (watercolor, oil-painting, cartoon, etc.). Wait for the user to pick one, then move to the inside.
Styles: watercolor, cartoon, oil-painting, ink, gouache, comic-book, linocut, cinematic, pencil, INLINECODE10
If no photo (text-based)
- 1. Ask about the person and vibe (1-2 questions max)
- Generate 3 front cover options — vary styles. Show all three, wait for pick.
- After they pick, ask what they want to say inside
- Generate inside image. Show a close-up (
POST /v1/cards/closeup) so the user can read the text. Wait for approval. - Generate animated preview (
POST /v1/cards/preview). Show it. - Iterate if needed — regenerate only the part that needs changing
Design guidelines: No AI-looking art. Use watercolor, gouache, ink, linocut, collage, letterpress. Front = visual design, avoid text. Inside = include message, clean typography. 3:4 portrait, 1500×2100px ideal.
QR codes (only when user asks)
Never include QR codes in AI image prompts — AI cannot generate scannable QR codes. Instead:
- 1. Generate card art normally (without QR)
- Use
POST /v1/cards/qr/composite to overlay a real QR code onto the approved image - Positions:
top-left, top-center, top-right, center, bottom-left, bottom-center, INLINECODE20 - Sizes:
small, medium, large. Optional label param for text below QR. - Use the returned
image_url as front_url or inside_url when ordering
Step 4: Get the address
Ask the user for the recipient's mailing address. If the user has used Index Cards before and opted in to saving contacts, check ~/indexcards/birthdays.json first — it may already have the address from a previous card.
Always confirm before using any saved address — people move. Also need a phone number (recipient's or sender's).
Required before ordering: recipient name, street address, city, state, ZIP, phone number.
Step 5: Payment
1 credit = 1 card. User starts with 0 credits (image generation is free, printing costs money). Pricing: $50 → 5 cards ($10 each), $100 → 12 cards ($8.33 each).
Check credits with GET /v1/credits/check. If no credits, send the payment URL from the response.
Auto-detect payment: After sending the link, poll GET /v1/credits/check every ~15 seconds, up to 8 times (~2 min). When credits appear, confirm and proceed with the order.
Invite codes: If an invite code is present in the page URL (?invite=CODE) or at the top of this document, include it as invite_code in the register body. This grants free credits — skip payment entirely. Say something like "You've got a free card — who's it for?"
Step 6: Place the order
Confirm everything before submitting: recipient, address, front design, inside message, occasion. Mention it costs 1 credit and arrives in 5-7 business days. Only place when user says yes. Orders are irreversible.
Step 7: After the order
Confirm simply: "Done! [Name]'s card is on its way — about 5-7 business days."
Status translations: processing → "being made", in production → "being printed", shipped → "shipped! [tracking link]", delivered → "delivered!"
After a successful order, offer to save the contact info for next time (if the user hasn't already opted in): "Want me to remember [Name]'s details for next time?"
Local contacts database (opt-in)
If the user agrees to saving contacts, maintain ~/indexcards/birthdays.json as a local cache.
CODEBLOCK0
Rules: MM-DD birthday format (no year). Don't duplicate — match on name. Update with every new piece of info. Append to cards_sent after every order. Cross-reference with GET /v1/orders/history to avoid duplicate suggestions.
Proactive suggestions (only if contacts database exists)
If ~/indexcards/birthdays.json exists (user previously opted in), at conversation start you may:
- 1. Check for birthdays/dates within 30 days, cross-ref with INLINECODE41
- Check holidays — Mother's Day, Father's Day, Valentine's, Christmas, graduations
- Review conversation history — hints like "my mom's been having a rough week"
Surface the 1-3 most timely suggestions naturally. Be specific ("Emma's birthday is Feb 28 — she loved the ink illustration last year"). Don't repeat suggestions the user already declined.
API Reference
Base URL: https://indexcards.com — all endpoints /v1/. Auth: Authorization: Bearer YOUR_API_KEY.
Register
CODEBLOCK1
Returns: api_key, credits, free_generations_remaining (10 free), invite_credits. No email or password required — this is an anonymous registration. Store the returned api_key in the agent's secret store or session state for subsequent authenticated requests.
Generate Card Art
Option A (preferred): User's own Gemini key — if the user has a Gemini API key configured (e.g. GOOGLE_API_KEY or GEMINI_API_KEY env vars), use it directly for higher quality and no generation limits:
CODEBLOCK2
Response: predictions[0].bytesBase64Encoded (base64 PNG). Save locally, upload via POST /v1/images/upload for a public URL.
Append to EVERY prompt when using Option A:
CODEBLOCK3
Option B (fallback): Index Cards API — 10 free generations, then requires credits.
CODEBLOCK4
Returns: image_url, generation_id, free_generations_remaining, credits. Prompt constraints applied server-side.
Routing: Use Option A for text-to-image if Gemini key exists. Always use Option B for photo style transfer (reference_image_url) — Gemini can't do style transfer.
Validation: Min 600px short side, ~3:4 aspect ratio required. Ideal 1500×2100px. 422 on failure.
Preview
CODEBLOCK5
Returns: preview_url / video_url (MP4). Always generate after front + inside are approved.
Close-up
CODEBLOCK6
Returns high-res JPEG. Use proactively when showing inside image so user can read text.
QR Code Composite
CODEBLOCK7
Returns: image_url with QR overlaid. Use this URL as front_url/inside_url for ordering.
Standalone QR: POST /v1/cards/qr with {"url": "...", "size": "medium"}.
Credits
CODEBLOCK8
Returns balance and Stripe payment links.
Place Order
CODEBLOCK9
Required: front_url, inside_url, recipient.name, recipient.address1, recipient.city, recipient.zip, phone (recipient or sender). Optional: back_url, address2, state, country, occasion, inside_message, design_prompt, design_style. Costs 1 credit. Irreversible.
Other Endpoints
| Endpoint | Method | Purpose |
|---|
| INLINECODE80 | GET | Order status (processing → in production → shipped → delivered) |
| INLINECODE81 |
GET | All past orders |
|
/v1/orders/history?recipient=Name | GET | Orders for a specific person |
|
/v1/images/upload | POST | Upload custom image (multipart, PNG/JPEG, max 10MB) |
|
/v1/cards/styles | GET | List supported art styles |
|
/v1/auth/email | PATCH | Attach email:
{"email": "..."} |
Error Codes
| Code | Meaning | Action |
|---|
| 400 | Bad request | Check required fields |
| 401 |
Bad API key | Check Authorization header |
| 402 | No credits | Show
payment_url from response |
| 404 | Not found | Check the ID |
| 422 | Image validation failed | Regenerate at correct specs |
| 429 | Rate limited | Wait
retry_after_seconds |
| 500 | Server error | Retry shortly |
Data Handling & Privacy
What this skill stores locally
- - API token: The Bearer token from
/v1/auth/register should be stored in the agent's session state or secret store. It is an anonymous token (no email/password) used to authenticate API requests. - Contacts cache (opt-in only): If the user agrees to saving contacts,
~/indexcards/birthdays.json stores names, birthdays, addresses, and card history. This file is user-visible and user-deletable. The agent only creates it after explicit user consent.
What this skill sends to the API
- - Card artwork: Image URLs (hosted on indexcards.com after upload) for the card front and inside
- Recipient mailing address: Name, street address, city, state, ZIP, phone — required for physical mail delivery
- Occasion and message text: Used for order records only
What this skill does NOT do
- - Does not read contacts, messages, calendar, or email without asking the user first
- Does not send contact data to the API — contact info is only cached locally (if user opts in) and used to pre-fill the address when sending a card
- Does not require or collect email addresses, passwords, or payment card numbers (payments happen via Stripe hosted checkout)
Payment flow
Credits are purchased via Stripe checkout. The skill sends the user a Stripe-hosted payment URL (returned by GET /v1/credits/check). No payment information passes through the skill or the Index Cards API. Invite codes grant free credits — no payment needed.
Homepage: https://indexcards.com
索引卡片 — 智能体技能
通过邮寄发送真实的实体问候卡片。以对话为先——您与用户共同设计卡片并发送。
规则
- - 保持对话性。 用通俗语言呈现结果以获得良好用户体验。说我正在设计您的卡片,而不是展示原始JSON、端点路径或HTTP状态码。
- 先沟通再行动。 未与用户沟通前不要调用API。不知道收卡人是谁以及他们想要什么之前,不要生成图像。
- 访问个人数据前先询问。 未经用户明确许可,绝不读取联系人、消息、电子邮件或本地文件。始终将其作为选项提供,绝不默认。
- 优雅处理不雅用语。 图像生成API有内容过滤器。如果用户消息包含粗俗语言,在保持语气的同时为图像提示重新措辞(例如去死吧→您真是个传奇)。
- 顺序生成图像。 一次一张——上游API限制并行请求速率(502错误)。
快捷方式:用户在一则消息中提供所有信息
如果用户在一则消息中提供了收件人姓名 + 正面描述 + 内部消息 + 地址,跳过多步流程:
- 1. 生成正面 → 生成内部 → 生成预览视频
- 显示预览 + 摘要 → 请求确认 → 下单
如果提供了大部分信息但缺少某些内容,执行快速流程并仅询问缺失部分。
第一步:首次消息
刚刚安装了索引卡片。我现在可以向任何人发送真实的实体卡片——生日、节日、感谢信,任何场合。您想给谁寄卡片?如果您愿意,我也可以查看您的联系人以了解即将到来的生日。
让用户决定是直接指定某人,还是让您帮助查找场合。
第二步:查找场合(仅限用户许可)
如果用户同意检查场合,按优先级顺序查看可用来源:
- 1. 联系人 — 生日字段、纪念日字段
- 日历/电子邮件 — 生日邀请、即将到来的活动
- 对话历史 — 提及的生日、婚礼、宝宝、感谢信
- 节日 — 母亲节、父亲节、情人节、圣诞节等30天内的节日
目标提前14天以上(卡片约需1周送达)。展示1-3个最及时的项目,询问是否要开始设计。
如果用户跳过此步骤且已经知道要给谁寄卡片,直接进入设计。
第三步:设计卡片
始终先设计正面,再设计内部。绝不同时生成两者。
如果用户发送照片
在生成API中使用referenceimageurl进行风格迁移。生成2-3种风格变体(水彩、油画、卡通等)。等待用户选择一种,然后进入内部。
风格:watercolor、cartoon、oil-painting、ink、gouache、comic-book、linocut、cinematic、pencil、pop_art
如果没有照片(基于文本)
- 1. 询问关于收件人和氛围(最多1-2个问题)
- 生成3个封面选项——变换风格。全部展示,等待选择。
- 选择后,询问内部想说什么
- 生成内部图像。显示特写(POST /v1/cards/closeup),以便用户阅读文字。等待批准。
- 生成动画预览(POST /v1/cards/preview)。展示。
- 如需迭代——仅重新生成需要更改的部分
设计指南: 不要有AI风格的艺术。使用水彩、水粉、墨水、油毡版画、拼贴、凸版印刷。正面=视觉设计,避免文字。内部=包含消息,干净排版。3:4竖版,理想尺寸1500×2100px。
二维码(仅当用户要求时)
绝不在AI图像提示中包含二维码——AI无法生成可扫描的二维码。改为:
- 1. 正常生成卡片艺术(不含二维码)
- 使用POST /v1/cards/qr/composite将真实二维码叠加到已批准的图像上
- 位置:top-left、top-center、top-right、center、bottom-left、bottom-center、bottom-right
- 尺寸:small、medium、large。可选label参数用于二维码下方文字。
- 下单时使用返回的imageurl作为fronturl或inside_url
第四步:获取地址
询问用户收件人的邮寄地址。如果用户之前使用过索引卡片并选择保存联系人,先检查~/indexcards/birthdays.json——可能已有之前卡片的地址。
使用任何已保存地址前务必确认——人们会搬家。还需要电话号码(收件人或寄件人的)。
下单前必需:收件人姓名、街道地址、城市、州、邮编、电话号码。
第五步:付款
1积分=1张卡片。用户初始0积分(图像生成免费,打印收费)。定价:50美元→5张卡片(每张10美元),100美元→12张卡片(每张8.33美元)。
使用GET /v1/credits/check检查积分。如果没有积分,发送响应中的付款URL。
自动检测付款: 发送链接后,每约15秒轮询GET /v1/credits/check,最多8次(约2分钟)。当积分出现时,确认并继续下单。
邀请码: 如果页面URL中有邀请码(?invite=CODE)或本文档顶部有邀请码,在注册体中包含为invite_code。这将授予免费积分——完全跳过付款。说类似您有一张免费卡片——给谁寄?
第六步:下单
提交前确认所有内容:收件人、地址、正面设计、内部消息、场合。提及消耗1积分,5-7个工作日送达。仅在用户同意时下单。 订单不可撤销。
第七步:下单后
简单确认:完成![姓名]的卡片正在路上——大约5-7个工作日。
状态翻译:processing→正在制作,in production→正在打印,shipped→已发货![追踪链接],delivered→已送达!
成功下单后,提供保存联系人信息以备下次使用(如果用户尚未选择加入):要我记住[姓名]的信息以便下次使用吗?
本地联系人数据库(选择加入)
如果用户同意保存联系人,维护~/indexcards/birthdays.json作为本地缓存。
json
{contacts: [{name: Kiall Wheatley, birthday: 02-19, relationship: friend,
address: {address1: 123 Main St, city: Springfield, state: IL, zip: 62704, country: US},
phone: +15551234567, notes: 喜欢徒步。偏好水彩。,
cardssent: [{date: 2026-02-11, occasion: birthday, style: watercolor mountain, message: 生日快乐!, orderid: e5f67c35}]}]}
规则:MM-DD生日格式(无年份)。不重复——按姓名匹配。每次有新信息时更新。每次下单后追加到cards_sent。与GET /v1/orders/history交叉引用以避免重复建议。
主动建议(仅当联系人数据库存在时)
如果~/indexcards/birthdays.json存在(用户之前选择加入),在对话开始时您可以:
- 1. 检查30天内的生日/日期,与cards_sent交叉引用
- 检查节日——母亲节、父亲节、情人节、圣诞节、毕业典礼
- 回顾对话历史——暗示如我妈妈这周过得很艰难
自然地展示1-3个最及时的建议。要具体(Emma的生日是2月28日——她去年很喜欢墨水插画)。不要重复用户已拒绝的建议。
API参考
基础URL:https://indexcards.com — 所有端点/v1/。认证:Authorization: Bearer YOURAPIKEY。
注册
POST /v1/auth/register
{invite_code: abc123def456} // 可选 — 如果URL中有?invite=CODE则包含
返回:apikey、credits、freegenerationsremaining(10次免费)、invitecredits。无需邮箱或密码——这是匿名注册。将返回的api_key存储在智能体的密钥存储或会话状态中,用于后续认证请求。
生成卡片艺术
选项A(首选):用户自己的Gemini密钥 — 如果用户配置了Gemini API密钥(例如GOOGLEAPIKEY或GEMINIAPIKEY环境变量),直接使用以获得更高质量且无生成限制:
POST https://generativelanguage.googleapis.com/v1beta/models/imagen-4.0-generate-001:predict?key=USER_KEY