Authentication Errors POST /analyze POST /search POST /chat DELETE /chat/:id

API Reference

Base URL: https://fastcork.com

Authentication

All API requests require a Bearer token in the Authorization header.

Authorization: Bearer fc-your_api_key_here
Get a key: Purchase at fastcork.com/#pricing. Your API key is displayed on the dashboard immediately after payment.

Errors

StatusMeaning
401Invalid or missing API key
402Insufficient credits (pay-as-you-go)
500Upstream error

Label Analysis

POST/v1/analyze

Analyze a wine label image and extract structured information. Accepts multipart/form-data.

Form fields

FieldTypeDescription
file requiredfileThe wine label image (JPEG, PNG, WebP)
langstringResponse language. Defaults to zh (Chinese) — pass en for English

Example

curl -X POST https://fastcork.com/v1/analyze \
  -H "Authorization: Bearer fc-your_key" \
  -F "file=@label.jpg" \
  -F "lang=en"

POST/v1/search

Natural language wine search with AI-powered recommendations.

Request body

FieldTypeDescription
query requiredstringNatural language query, e.g. "bold reds under $30 for grilled lamb"
langstringResponse language. Defaults to zh (Chinese) — pass en for English

Example

curl -X POST https://fastcork.com/v1/search \
  -H "Authorization: Bearer fc-your_key" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "bold reds under $30 for grilled lamb",
  "lang": "en"
}'

Sommelier Chat

POST/v1/chat

Multi-turn conversation with an AI sommelier. Send a sessionId to continue a conversation.

Request body

FieldTypeDescription
message requiredstringUser message
sessionIdstringOmit to start a new session; include to continue
imagesstring[]Optional array of raw base64 images (no data URI prefix) — wine labels, lists, or menus
langstringResponse language. Defaults to zh — pass en for English

Example — new session

curl -X POST https://fastcork.com/v1/chat \
  -H "Authorization: Bearer fc-your_key" \
  -H "Content-Type: application/json" \
  -d '{
  "message": "What wine pairs well with duck confit?",
  "lang": "en"
}'

Response

{
  "sessionId": "abc123",
  "reply": {
    "type": "recommendation",
    "cards": [
      { "title": "Chateau Lafleur Pomerol", "subtitle": "Bordeaux, France", "badge": "Top pick" }
    ],
    "explanation": "Duck confit pairs beautifully with a silky Pomerol..."
  }
}

Delete Chat Session

DELETE/v1/chat/:sessionId

Delete a chat session and free server-side memory.

curl -X DELETE https://fastcork.com/v1/chat/abc123 \
  -H "Authorization: Bearer fc-your_key"