jiajun.fyi API

jiajun.fyi 各个服务的接口:信息库、英语练习、菜谱、通勤。给 AI agent 用:先读 llms.txt,按目标挑服务和接口,再调用。

交给 agent

把这段复制给 Claude Code、Codex、ChatGPT 这类 agent。它会自己读 llms.txt、挑接口、用环境变量里的密钥去调。

You are my agent for the services on jiajun.fyi. Fetch https://dev.jiajun.fyi/llms.txt, pick the service and endpoint that fit my goal, then fetch that service's own llms.txt or OpenAPI before calling it. Do not guess endpoints, fields or scopes.

Read the API key from the PIH_API_KEY environment variable, or from ~/.personal-info-hub/pih.env. If it is missing, run `pih login --scopes <the scopes the task needs>` and give me the link it prints to approve. Never ask me to paste the key into chat, put it in browser code, or commit it.

Only call services marked as callable with a key. For anything behind a login, say so and stop rather than working around it.

When you answer from my library, name the items you used (title and hub link) and give timestamps for videos. Write (collect, star, note) only when I ask.

怎么开始

  1. 在 agent 所在的机器上跑 pih login(要别的权限加 --scopes),在它给的 jiajun.fyi 链接上点「授权」:密钥写进 ~/.personal-info-hub/pih.env 的 PIH_API_KEY,不经过对话。没有 pih 的环境就在 jiajun.fyi → 管理 → 设置 → API 密钥 新建一把,放进 PIH_API_KEY。
  2. 把上面的提示词交给 agent。它从 llms.txt 开始,每次调用都带 Authorization: Bearer pih_...。

「密钥可调」的服务 agent 能直接用;「需登录」的在 Cloudflare Access 后面,只有本人浏览器能开,agent 调不了。

服务

信息库 · 开放 API

pih-api.jiajun.fyi

密钥可调

搜索和读取收藏的一切:文章、帖子、视频文字稿(带时间线)、媒体;收录链接、标星、写备注。给 agent 用的稳定接口。收录链接的服务可登记回调 Webhook(已收录 / 处理完成 / 处理失败),不用轮询。

鉴权Authorization: Bearer pih_... (scoped key)

llms.txtOpenAPIReference

103 个接口

Endpoints

GET/searchSearch the librarysearch:read
GET/itemsList itemsitems:read
GET/shotsVideos laid out as shots (切片)items:read
GET/items/{id}Get one itemitems:read
GET/items/{id}/contentGet an item's contentitems:read
GET/items/{id}/media/{mediaId}Download one media file by its stable addressmedia:read
GET/items/{id}/timelineRead a video or episode as a timelineitems:read
PUT/items/{id}/noteSet an item's notenotes:write
POST/items/{id}/starStar or unstar an itemnotes:write
POST/items/{id}/laterMark or clear read / watch laternotes:write
POST/collectCollect a linkcollect:write
POST/flomo/memosWrite a memo to Flomonotes:write
GET/english/wordsList English wordsenglish:read
GET/english/practiceList English practice recordsenglish:read
GET/songbook/songsList songbook songs with their linkssongbook:read
POST/songbook/songsAdd a song to the songbooksongbook:write
POST/songbook/score-takesSave a recording and its detected notessongbook:write
GET/songbook/score-takesList 扒谱结果 (takes saved from 实时扒谱)songbook:read
GET/songbook/score-takes/{id}Read one 扒谱结果 with its MusicXML and lyricssongbook:read
POST/songbook/links/matchMatch a batch of songbook linkssongbook:write
PATCH/songbook/songs/{key}/links/{service}Set a song's link by handsongbook:write
GET/songbook/tracklistsList tracklistssongbook:read
POST/songbook/tracklistsAsk for a 1001Tracklists setsongbook:write
GET/songbook/tracklists/{id}Read one tracklistsongbook:read
POST/songbook/tracklists/{id}/rereadRead a stored set page againsongbook:write
GET/songbook/sheetsList 图图乐谱 sheetssongbook:read
PATCH/songbook/sheets/{key}Change a song's 图图乐谱 sheetsongbook:write
POST/things/wantedRecord something the owner wants to buy (记到想买)things:write
GET/things/productsSearch 物品 (products)things:read
GET/things/wanted-webhookRead the 想买 Webhook addressthings:write
POST/things/wanted-webhookMake a new 想买 Webhook addressthings:write
GET/things/wanted.shortcutDownload the signed 记到想买 Shortcutthings:write
GET/restaurantsSearch 餐厅 (restaurants)restaurants:read
POST/restaurantsAdd a restaurant (or find it)restaurants:write
GET/restaurants/{id}Read one restaurantrestaurants:read
PATCH/restaurants/{id}Change a restaurantrestaurants:write
POST/restaurants/{id}/visitsRecord a visit (去吃了)restaurants:write
POST/restaurants/{id}/linksLink two stores (关联的店)restaurants:write
PATCH/restaurants/{id}/links/{linkId}Confirm or remove a linkrestaurants:write
GET/restaurants/{id}/reviewsRead a restaurant's reviews (评价)restaurants:read
PATCH/restaurants/{id}/reviewsPin or settle a review listingrestaurants:write
POST/restaurants/{id}/reviews/refreshFetch a restaurant's reviews againrestaurants:write
GET/booksList 读书 (WeRead books)books:read
GET/books/highlightsSearch highlights and thoughts (划线、想法)books:read
GET/books/statsRead 阅读时长 (reading time)books:read
GET/books/{id}Read one book's notesbooks:read
POST/books/syncSync WeRead now (立即同步)books:write
GET/peopleList 人物 (people)people:read
POST/peopleAdd a person (or find them)people:write
GET/people/{id}Read one person and their itemspeople:read
PATCH/people/{id}Rename a person, or change aliases or descriptionpeople:write
POST/people/{id}/mergeMerge two records of the same personpeople:write
POST/people/{id}/itemsLink an item to a personpeople:write
PATCH/people/{id}/items/{itemId}Change or remove a person's itempeople:write
GET/recipesList 菜谱 (recipes)recipes:read
POST/recipesWrite your own recipe version for a saved postrecipes:write
GET/recipes/{id}Read one reciperecipes:read
GET/recipes/{id}/versionsList every version of a dishrecipes:read
PUT/recipes/{id}/wantMark 想做 (want to cook), or take it backrecipes:write
POST/recipes/{id}/cookedLog a 做过 (cooked it)recipes:write
POST/recipes/{id}/planPlan the dish for a day (排餐), or take it offrecipes:write
POST/recipes/groceryAdd a line to the grocery list (采购清单)recipes:write
POST/recipes/importTurn saved posts or videos into recipesrecipes:write
POST/feedbackReport a problem, a missing capability or an ideaany key
GET/feedbackList agent feedbackfeedback:read
GET/feedback/{id}Read one report (by id or FB-12) with its logs and callsfeedback:read
PATCH/feedback/{id}Sort, resolve or merge a report (by id or FB-12)feedback:read
GET/todosList 待办 (todos)todos:read
POST/todosAdd a todotodos:write
PATCH/todos/{id}Change a todo, complete, drop or reopen ittodos:write
GET/card-notesList 卡片笔记 (card notes), newest firstcard_notes:read
POST/card-notesAdd a card notecard_notes:write
GET/card-notes/tagsList the tags in the card box, with countscard_notes:read
GET/card-notes/{id}Read one card notecard_notes:read
PATCH/card-notes/{id}Change a card note, or take it back (撤销)card_notes:write
GET/tutu/mediaList 图图's photos and videostutu:read
GET/tutu/media/{id}Get one of 图图's photos or videostutu:read
GET/tutu/daysList 图图's daycare days: arrival, pick-up and napstutu:read
PUT/tutu/push-deviceTurn new-photo notifications on or off for one devicetutu:read
GET/tutu/home-logsList 图图's home logs: sleep, wake-up, meals, poops, photostutu:read
POST/tutu/home-logsLog something at home: fell asleep, woke up, a meal, a poop, a phototutu:write
GET/tutu/home-logs/{id}Get one home logtutu:read
PATCH/tutu/home-logs/{id}Change a home log, or take it back (撤销)tutu:write
POST/tutu/home-logs/{id}/photosAdd a photo to a home logtutu:write
GET/tutu/growthList 图图's growth measurementstutu:read
POST/tutu/growthAdd a growth measurementhealth:write
GET/tutu/growth/chart图图's growth chart with WHO bandstutu:read
GET/tutu/health/recordsList 图图's health recordshealth:read
POST/tutu/health/recordsAdd a health recordhealth:write
GET/tutu/health/records/{id}Get one health recordhealth:read
PATCH/tutu/health/records/{id}Change a health recordhealth:write
GET/tutu/health/vaccines图图's vaccineshealth:read
GET/connectorsHow each 同步源 (sync) standsitems:read
POST/notifyTell the owner somethingnotify:write
POST/tikhubMake one TikHub request through the hubtikhub:call
POST/rendersRender a Blender scene (queued)renders:write
GET/renders/{id}Read a render: status and progressrenders:read
GET/renders/{id}/framesList a render's framesrenders:read
GET/renders/{id}/frames/{name}Read one framerenders:read

Callback webhooks

Sent to an HTTPS endpoint the owner registers for your key; see llms.txt「Service callers」.

EVENTitem.collectedItem collected: fetched, still processingsigned (Standard Webhooks)
EVENTitem.readyItem ready: all processing donesigned (Standard Webhooks)
EVENTitem.failedItem failed, with reasonsigned (Standard Webhooks)
EVENTwebhook.testTest eventsigned (Standard Webhooks)

信息库 · 内部接口

api.hub.jiajun.fyi

密钥可调

hub 网页、Chrome 插件、pih CLI、MCP 用的 /api。API 密钥按权限范围可调;不保证稳定,能用开放 API 就用开放 API。

鉴权Authorization: Bearer pih_... with the scope in each row; every DELETE and any unlisted route needs admin

115 个接口 · 内部,不保证稳定

Items

GET/api/itemsItem cards, newest first; with q it searchesitems:read (search:read with q)
POST/api/itemsCollect a URLcollect:write
GET/api/items/facetsCounts for the sidebar filtersitems:read
GET/api/items/tagsTop tagsitems:read
GET/api/stats/collectedItems collected per Pacific day and source (?days=30|90)admin
GET/api/items/{id}Full item detail (the hub item page)items:read
POST/api/items/{id}/starStar or unstarnotes:write
GET/api/items/{id}/statusProcessing stagesitems:read
GET/api/items/{id}/mediaMedia rehost statusitems:read
GET/api/media/{id}A stored media file (Range supported)items:read
GET/api/x-bookmarks/searchSearch X bookmarkssearch:read
POST/api/integrations/flomo/memosWrite a memo to Flomonotes:write

Processing

POST/api/items/{id}/mediaQueue a media rehostsync:write
POST/api/items/{id}/refetchFetch the item againsync:write
POST/api/items/{id}/repliesExpand comment replies (paid TikHub calls)sync:write
POST/api/items/{id}/transcribeQueue a Whisper transcriptionsync:write
POST/api/items/{id}/reprocessRun processing againsync:write

Collectors and sync

For the owner's own sync clients (extension, pih CLI, hercules jobs).

POST/api/import/{source}Bulk import: browser-bookmarks, x-bookmarks, youtube-saved-videos, bilibili-favorites, instagram-saved-items, xiaohongshu-favorites, xiaohongshu-liked-itemssync:write
GET/api/source-connectorsList sync sourcessync:write
POST/api/source-connectorsCreate or update a sync sourcesync:write
POST/api/source-connectors/{id}/{action}sync-result, boost, pause, resume, retry, triggersync:write
POST/api/recordingsRecorded list responses (X bookmarks, Xiaohongshu): store, read, importsync:write
GET/api/extension/scrapers/{name}Extension page recorder sourcesync:write
GET/api/brightwheel/fetch-planBrightwheel fetch plansync:write
POST/api/brightwheel/import-batchBrightwheel importsync:write
POST/api/brightwheel/capturesBrightwheel capturessync:write
GET/api/storage/objectsList or read private objects (key or prefix)sync:write
PUT/api/storage/objectsWrite a private object if absent (never overwrites or deletes); with uploadId&partNumber, one part of a multipart uploadsync:write
POST/api/storage/objectsMultipart upload for files over 100 MiB: ?uploads starts, ?uploadId completes (or &abort)sync:write
POST/api/watch-history/itemsReport watched titles (Emby)sync:write
POST/api/watch-history/eventsReport watch sessionssync:write
GET/api/watch-history/watchedWhat counts as watchedsync:write
PUT/api/watch-history/items/{id}/captionsUpload a title's subtitlessync:write
PUT/api/watch-history/items/{id}/audioUpload a title's audio for transcriptionsync:write
POST/api/cue-clips/planPlan sentence clips for studied wordssync:write
POST/api/video-stills/planQueue a video still for every timed recipe step without one (?item= for one item)admin
GET/api/cue-clips/queueClips waiting to be cutsync:write
PUT/api/cue-clips/{id}/fileUpload a cut clipsync:write
POST/api/cue-clips/{id}/failedMark a clip failedsync:write
POST/api/jobs/claimClaim this Mac's most urgent queued jobs (video_rehost, upgrade_video), leasedsync:write
POST/api/jobs/{id}/heartbeatRenew a claimed job's lease, with its progresssync:write
POST/api/jobs/releaseGive claimed jobs back untouchedsync:write
GET/api/jobs/overviewJobs queue: backlog by status, runner and type; failures; attention; quotasadmin
GET/api/jobsOne group of jobs (status, runner, type, error prefix)admin
POST/api/jobs/{id}/retryRun a job again nowadmin
POST/api/jobs/{id}/cancelCall a job offadmin
POST/api/jobs/bulkRetry or close a whole failure groupadmin
POST/api/items/{id}/video-rehostRegister a rehosted videosync:write
POST/api/items/{id}/captions/punctuatePunctuate machine captionssync:write
GET/api/captions/readable-pendingCaptions waiting for punctuationsync:write

Photo prints (冲印)

Which photos were printed. The Google Photos extension uses its own key; tutu.jiajun.fyi goes through its Access login.

GET/api/photo-prints待冲印, 待确认 and every print batch with its photosphoto_prints:read
POST/api/photo-printsAdd photos to 待冲印 ({photos: [{mediaKey | publicId, takenAt?, thumbUrl?}]}); status unconfirmed for an album importphoto_prints:write
POST/api/photo-prints/statusWas each photo printed or waiting? (by media key, short id or taken time)photo_prints:read
POST/api/photo-prints/batchesRecord a print batch: date, vendor, size for the chosen photosphoto_prints:write
PATCH/api/photo-prints/{id}Move a 待确认 photo to 待冲印photo_prints:write

Restaurants (餐厅)

The same record as the public API's /restaurants; agents use that one. Deletes are admin only.

GET/api/restaurantsList restaurants (?q=&status=want|been&area=&cuisine=&links=unconfirmed|review)restaurants:read
GET/api/restaurants/{id}One restaurant with its linked stores and visitsrestaurants:read
POST/api/restaurantsAdd a restaurant, or find the one already there (same name + place) and fill in what it lacked; another place is another store, linked to the same-name onesrestaurants:write
PATCH/api/restaurants/{id}Change fieldsrestaurants:write
POST/api/restaurants/{id}/visitsRecord a visit; the restaurant becomes 去过restaurants:write
POST/api/restaurants/{id}/linksLink another store (关联的店, 已确认)restaurants:write
PATCH/api/restaurants/{id}/links/{linkId}Confirm a link, mark it 待清洗, or remove itrestaurants:write
DELETE/api/restaurants/{id}Remove a restaurant recorded by mistake, with its visits, links and reviewsadmin
DELETE/api/restaurants/visits/{id}Remove one visitadmin

Books (读书)

WeRead (微信读书), synced read-only by the API; the same record as the public API's /books. Private books need ?includePrivate=true. The key is set on jiajun.fyi/admin/settings (管理 → 设置 → 微信读书).

GET/api/booksBooks (?status=reading|finished|unread|all&q=&includePrivate=&cursor=&limit=), with counts and sync statebooks:read
GET/api/books/{id}One book: highlights by chapter, thoughts under them, reviewsbooks:read
GET/api/books/highlightsSearch highlights and thoughts (?q=&bookId=)books:read
GET/api/books/statsReading time (?range=week|month|year|total)books:read
POST/api/books/syncSync WeRead now (立即同步)books:write
GET/api/settings/wereadKey status (last four characters only), sync state, countsadmin
PUT/api/settings/wereadSave the wrk- key (encrypted) and test itadmin
POST/api/settings/weread/testTest the saved keyadmin
DELETE/api/settings/wereadRemove the keyadmin

People (人物)

People from the library (interview guests, hosts, authors, subjects) with their items; the same record as the public API's /people. New items are read by 人物识别 after their summary.

GET/api/peoplePeople, most items first (?q=&role=&cursor=&limit=)people:read
GET/api/people/{id}One person with their itemspeople:read
POST/api/peopleAdd, or find the one already there by name or aliaspeople:write
PATCH/api/people/{id}Rename, aliases, description, linkpeople:write
POST/api/people/{id}/mergeFold another person into this one ({personId})people:write
POST/api/people/{id}/itemsLink an item ({itemId, role})people:write
PATCH/api/people/{id}/items/{itemId}Change the role, or remove the link ({removed: true})people:write
POST/api/people/detectionsImport the backfill's detections (scripts/people-backfill.mjs)admin
DELETE/api/people/{id}Remove a person recorded by mistake (items stay)admin

Todos (待办)

The owner's todo list, kept on the hub's 待办 page; the same record as the public API's /todos. Each todo names who added it (owner or the key). Nothing deletes one.

GET/api/todosTodos: open first by priority and due date (?status=&priority=&tag=&q=&cursor=&limit=)todos:read
POST/api/todosAdd ({title, note?, priority?, dueDate?, tags?})todos:write
PATCH/api/todos/{id}Change any field, or statustodos:write
POST/api/todos/{id}/completeMark done (also reopen, drop)todos:write
POST/api/todos/reorderHand order ({ids}, first to last)todos:write

Admin

Owner tools. A key needs admin; backups take the internal token only.

GET/api/api-keysList API keysadmin
POST/api/api-keysCreate an API key (shown once)admin
POST/api/api-keys/{id}/revokeRevoke a keyadmin
GET/api/api-keys/{id}/callsA key's recent callsadmin
GET/api/agentsThe owner's agents (jiajun.fyi/agent) with their key stateagents:manage
POST/api/agentsCreate an agent and its pih_ key (shown once; never admin, always expires)agents:manage
PATCH/api/agents/{id}Change an agent's permissions and its key's scopes in placeagents:manage
POST/api/agents/{id}/{action}rotate (new key, same scopes, old revoked) or revokeagents:manage
GET/api/webhooksCallback webhook endpoints (?keyId=)admin
POST/api/webhooksRegister an endpoint for a key (signing secret shown once)admin
POST/api/webhooks/{id}/{action}test, disable, enable, rotate-secret, move (to a new key)admin
GET/api/webhooks/{id}/eventsRecent events with every delivery attemptadmin
POST/api/webhooks/events/{id}/redeliverSend an event againadmin
GET/api/settings/collect-webhookRead, rotate (POST) or disable (DELETE) the collect webhookadmin
GET/api/settings/flomoFlomo settings (PUT, DELETE)admin
GET/api/model-runs/summaryModel cost summaryadmin
GET/api/tikhub/budgetTikHub budget (PUT to change)admin
GET/api/notifications/channelsNotification channelsadmin
POST/api/notifications/sendSend a notificationadmin
GET/api/notifications/logDelivery logadmin
GET/api/system/capabilitiesSystem statusadmin
POST/api/payloadsKeep a raw payloadadmin
GET/api/backup/rowsTable rows for the nightly backupinternal token only

No credential

These carry their own proof: a secret in the path, a signature, or a public item.

GET/healthHealth checknone
POST/api/webhook/collect/{secret}iOS share-sheet collect (GET with ?url= also works)secret in the URL
POST/api/webhook/things/{secret}记到想买 from a Shortcut or any tool: {text} / {url} / an image (GET with ?text= or ?url= also works)secret in the URL
GET/api/public/media/{id}Signed media linksignature
GET/api/public/items/{id}Public fields of an item marked publicnone

英语练习

english.jiajun.fyi

英语表达练习、欧路生词本、发音评分、看视频学单词。只认登录;agent 读练习数据走开放 API 的 /english/*。

鉴权Cloudflare Access (owner login)

14 个接口

Practice

GET/api/english-practicePractice records (POST adds one)login
PATCH/api/english-practice/{id}Update a record (mastery)login
GET/api/english-practice/sync-stateCursor for the practice sync (PUT moves it)login
GET/api/english-practice/sourcesSource prompts (POST adds)login
GET/api/english-practice/known-termsTerms already masteredlogin

Words and pronunciation

GET/api/eudic-wordsWords in a Eudic book, with sync statuslogin
PUT/api/eudic-words/starSet a word's masterylogin
GET/api/eudic-words/star-eventsA word's mastery historylogin
GET/api/pronunciation/ttsReference audio for a textlogin
GET/api/pronunciation/attemptsScored attempts (POST scores a new one)login
GET/api/pronunciation/recordingA recorded attemptlogin
GET/api/word-clipsMoments in watched videos where a word is spokenlogin
GET/api/word-clips/clip/{id}A sentence cliplogin
GET/api/word-clips/media/{id}The full media filelogin

菜谱

recipes.jiajun.fyi

从收藏里整理出的菜谱、本周排餐和采购清单。只认登录。

鉴权Cloudflare Access (owner login)

9 个接口
GET/api/recipesAll recipeslogin
GET/api/recipes/{n}One recipelogin
PUT/api/recipes/{n}/wantMark as want to cooklogin
POST/api/recipes/{n}/cookedLog that it was cookedlogin
GET/api/items/{id}/recipesRecipes cut from one library itemlogin
GET/api/planThe week's meal plan (POST adds, DELETE /api/plan/{n} removes)login
GET/api/groceryThe week's grocery list (POST adds, DELETE /api/grocery/{n} removes)login
PUT/api/grocery/checkTick grocery itemslogin
GET/api/media/{id}A recipe's picture or videologin

测评

evals.jiajun.fyi

我自己做过的模型 / 引擎对比和测试集。只认登录;bench 脚本用 Access 服务令牌 jc-evals 导入,格式见 docs/evaluations.md。

鉴权Cloudflare Access (owner login, or the jc-evals service token for imports)

6 个接口
GET/api/evaluationsAll evaluations (POST imports one, upsert by slug)login
GET/api/evaluations/{slug}One evaluation with its samples and fileslogin
PUT/api/evaluations/{slug}/files/{name}Store a raw file in R2 (GET reads it back)login
GET/api/test-setsTest sets (POST saves one)login
GET/api/test-sets/{slug}One test set and the evaluations run on itlogin
GET/api/test-sets/candidatesLibrary items that could join a test setlogin

Caltrain 通勤

caltrain.jiajun.fyi

公开

实时 Caltrain 班次和通勤提醒。/status 公开可读;设置页要登录。

鉴权None for /status; /settings behind Cloudflare Access; /api/action takes the hub's internal token

6 个接口
GET/statusLive train predictions (JSON); with ?from=&to= station ids, any station pair from the timetablenone
GET/stationsStation ids and names, north to southnone
GET/passingsWhen commute trains really left the two boarding platforms (last 30 days)none
GET/healthHealth checknone
GET/settingsReminder settings (?format=json; POST saves)login
POST/api/actionButton actions from the Feishu botinternal token

公开分享

share.jiajun.fyi

公开

标为公开的条目的网页。只出 HTML,不是 JSON 接口。

鉴权None

1 个接口
GET/{id}The public page of one itemnone

其他