jiajun.fyi API
jiajun.fyi 各个服务的接口:信息库、英语练习、菜谱、通勤。给 AI agent 用:先读 llms.txt,按目标挑服务和接口,再调用。
llms.txtonboarding 提示词services.json信息库接口参考
交给 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.
怎么开始
- 在 agent 所在的机器上跑
pih login(要别的权限加--scopes),在它给的 jiajun.fyi 链接上点「授权」:密钥写进~/.personal-info-hub/pih.env的PIH_API_KEY,不经过对话。没有 pih 的环境就在 jiajun.fyi → 管理 → 设置 → API 密钥 新建一把,放进PIH_API_KEY。 - 把上面的提示词交给 agent。它从 llms.txt 开始,每次调用都带
Authorization: Bearer pih_...。
「密钥可调」的服务 agent 能直接用;「需登录」的在 Cloudflare Access 后面,只有本人浏览器能开,agent 调不了。
服务
信息库 · 开放 API
pih-api.jiajun.fyi
搜索和读取收藏的一切:文章、帖子、视频文字稿(带时间线)、媒体;收录链接、标星、写备注。给 agent 用的稳定接口。收录链接的服务可登记回调 Webhook(已收录 / 处理完成 / 处理失败),不用轮询。
鉴权Authorization: Bearer pih_... (scoped key)
103 个接口
Endpoints
/searchSearch the librarysearch:read/itemsList itemsitems:read/shotsVideos laid out as shots (切片)items:read/items/{id}Get one itemitems:read/items/{id}/contentGet an item's contentitems:read/items/{id}/media/{mediaId}Download one media file by its stable addressmedia:read/items/{id}/timelineRead a video or episode as a timelineitems:read/items/{id}/noteSet an item's notenotes:write/items/{id}/starStar or unstar an itemnotes:write/items/{id}/laterMark or clear read / watch laternotes:write/collectCollect a linkcollect:write/flomo/memosWrite a memo to Flomonotes:write/english/wordsList English wordsenglish:read/english/practiceList English practice recordsenglish:read/songbook/songsList songbook songs with their linkssongbook:read/songbook/songsAdd a song to the songbooksongbook:write/songbook/score-takesSave a recording and its detected notessongbook:write/songbook/score-takesList 扒谱结果 (takes saved from 实时扒谱)songbook:read/songbook/score-takes/{id}Read one 扒谱结果 with its MusicXML and lyricssongbook:read/songbook/links/matchMatch a batch of songbook linkssongbook:write/songbook/songs/{key}/links/{service}Set a song's link by handsongbook:write/songbook/tracklistsList tracklistssongbook:read/songbook/tracklistsAsk for a 1001Tracklists setsongbook:write/songbook/tracklists/{id}Read one tracklistsongbook:read/songbook/tracklists/{id}/rereadRead a stored set page againsongbook:write/songbook/sheetsList 图图乐谱 sheetssongbook:read/songbook/sheets/{key}Change a song's 图图乐谱 sheetsongbook:write/things/wantedRecord something the owner wants to buy (记到想买)things:write/things/productsSearch 物品 (products)things:read/things/wanted-webhookRead the 想买 Webhook addressthings:write/things/wanted-webhookMake a new 想买 Webhook addressthings:write/things/wanted.shortcutDownload the signed 记到想买 Shortcutthings:write/restaurantsSearch 餐厅 (restaurants)restaurants:read/restaurantsAdd a restaurant (or find it)restaurants:write/restaurants/{id}Read one restaurantrestaurants:read/restaurants/{id}Change a restaurantrestaurants:write/restaurants/{id}/visitsRecord a visit (去吃了)restaurants:write/restaurants/{id}/linksLink two stores (关联的店)restaurants:write/restaurants/{id}/links/{linkId}Confirm or remove a linkrestaurants:write/restaurants/{id}/reviewsRead a restaurant's reviews (评价)restaurants:read/restaurants/{id}/reviewsPin or settle a review listingrestaurants:write/restaurants/{id}/reviews/refreshFetch a restaurant's reviews againrestaurants:write/booksList 读书 (WeRead books)books:read/books/highlightsSearch highlights and thoughts (划线、想法)books:read/books/statsRead 阅读时长 (reading time)books:read/books/{id}Read one book's notesbooks:read/books/syncSync WeRead now (立即同步)books:write/peopleList 人物 (people)people:read/peopleAdd a person (or find them)people:write/people/{id}Read one person and their itemspeople:read/people/{id}Rename a person, or change aliases or descriptionpeople:write/people/{id}/mergeMerge two records of the same personpeople:write/people/{id}/itemsLink an item to a personpeople:write/people/{id}/items/{itemId}Change or remove a person's itempeople:write/recipesList 菜谱 (recipes)recipes:read/recipesWrite your own recipe version for a saved postrecipes:write/recipes/{id}Read one reciperecipes:read/recipes/{id}/versionsList every version of a dishrecipes:read/recipes/{id}/wantMark 想做 (want to cook), or take it backrecipes:write/recipes/{id}/cookedLog a 做过 (cooked it)recipes:write/recipes/{id}/planPlan the dish for a day (排餐), or take it offrecipes:write/recipes/groceryAdd a line to the grocery list (采购清单)recipes:write/recipes/importTurn saved posts or videos into recipesrecipes:write/feedbackReport a problem, a missing capability or an ideaany key/feedbackList agent feedbackfeedback:read/feedback/{id}Read one report (by id or FB-12) with its logs and callsfeedback:read/feedback/{id}Sort, resolve or merge a report (by id or FB-12)feedback:read/todosList 待办 (todos)todos:read/todosAdd a todotodos:write/todos/{id}Change a todo, complete, drop or reopen ittodos:write/card-notesList 卡片笔记 (card notes), newest firstcard_notes:read/card-notesAdd a card notecard_notes:write/card-notes/tagsList the tags in the card box, with countscard_notes:read/card-notes/{id}Read one card notecard_notes:read/card-notes/{id}Change a card note, or take it back (撤销)card_notes:write/tutu/mediaList 图图's photos and videostutu:read/tutu/media/{id}Get one of 图图's photos or videostutu:read/tutu/daysList 图图's daycare days: arrival, pick-up and napstutu:read/tutu/push-deviceTurn new-photo notifications on or off for one devicetutu:read/tutu/home-logsList 图图's home logs: sleep, wake-up, meals, poops, photostutu:read/tutu/home-logsLog something at home: fell asleep, woke up, a meal, a poop, a phototutu:write/tutu/home-logs/{id}Get one home logtutu:read/tutu/home-logs/{id}Change a home log, or take it back (撤销)tutu:write/tutu/home-logs/{id}/photosAdd a photo to a home logtutu:write/tutu/growthList 图图's growth measurementstutu:read/tutu/growthAdd a growth measurementhealth:write/tutu/growth/chart图图's growth chart with WHO bandstutu:read/tutu/health/recordsList 图图's health recordshealth:read/tutu/health/recordsAdd a health recordhealth:write/tutu/health/records/{id}Get one health recordhealth:read/tutu/health/records/{id}Change a health recordhealth:write/tutu/health/vaccines图图's vaccineshealth:read/connectorsHow each 同步源 (sync) standsitems:read/notifyTell the owner somethingnotify:write/tikhubMake one TikHub request through the hubtikhub:call/rendersRender a Blender scene (queued)renders:write/renders/{id}Read a render: status and progressrenders:read/renders/{id}/framesList a render's framesrenders:read/renders/{id}/frames/{name}Read one framerenders:readCallback webhooks
Sent to an HTTPS endpoint the owner registers for your key; see llms.txt「Service callers」.
item.collectedItem collected: fetched, still processingsigned (Standard Webhooks)item.readyItem ready: all processing donesigned (Standard Webhooks)item.failedItem failed, with reasonsigned (Standard Webhooks)webhook.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
/api/itemsItem cards, newest first; with q it searchesitems:read (search:read with q)/api/itemsCollect a URLcollect:write/api/items/facetsCounts for the sidebar filtersitems:read/api/items/tagsTop tagsitems:read/api/stats/collectedItems collected per Pacific day and source (?days=30|90)admin/api/items/{id}Full item detail (the hub item page)items:read/api/items/{id}/starStar or unstarnotes:write/api/items/{id}/statusProcessing stagesitems:read/api/items/{id}/mediaMedia rehost statusitems:read/api/media/{id}A stored media file (Range supported)items:read/api/x-bookmarks/searchSearch X bookmarkssearch:read/api/integrations/flomo/memosWrite a memo to Flomonotes:writeProcessing
/api/items/{id}/mediaQueue a media rehostsync:write/api/items/{id}/refetchFetch the item againsync:write/api/items/{id}/repliesExpand comment replies (paid TikHub calls)sync:write/api/items/{id}/transcribeQueue a Whisper transcriptionsync:write/api/items/{id}/reprocessRun processing againsync:writeCollectors and sync
For the owner's own sync clients (extension, pih CLI, hercules jobs).
/api/import/{source}Bulk import: browser-bookmarks, x-bookmarks, youtube-saved-videos, bilibili-favorites, instagram-saved-items, xiaohongshu-favorites, xiaohongshu-liked-itemssync:write/api/source-connectorsList sync sourcessync:write/api/source-connectorsCreate or update a sync sourcesync:write/api/source-connectors/{id}/{action}sync-result, boost, pause, resume, retry, triggersync:write/api/recordingsRecorded list responses (X bookmarks, Xiaohongshu): store, read, importsync:write/api/extension/scrapers/{name}Extension page recorder sourcesync:write/api/brightwheel/fetch-planBrightwheel fetch plansync:write/api/brightwheel/import-batchBrightwheel importsync:write/api/brightwheel/capturesBrightwheel capturessync:write/api/storage/objectsList or read private objects (key or prefix)sync:write/api/storage/objectsWrite a private object if absent (never overwrites or deletes); with uploadId&partNumber, one part of a multipart uploadsync:write/api/storage/objectsMultipart upload for files over 100 MiB: ?uploads starts, ?uploadId completes (or &abort)sync:write/api/watch-history/itemsReport watched titles (Emby)sync:write/api/watch-history/eventsReport watch sessionssync:write/api/watch-history/watchedWhat counts as watchedsync:write/api/watch-history/items/{id}/captionsUpload a title's subtitlessync:write/api/watch-history/items/{id}/audioUpload a title's audio for transcriptionsync:write/api/cue-clips/planPlan sentence clips for studied wordssync:write/api/video-stills/planQueue a video still for every timed recipe step without one (?item= for one item)admin/api/cue-clips/queueClips waiting to be cutsync:write/api/cue-clips/{id}/fileUpload a cut clipsync:write/api/cue-clips/{id}/failedMark a clip failedsync:write/api/jobs/claimClaim this Mac's most urgent queued jobs (video_rehost, upgrade_video), leasedsync:write/api/jobs/{id}/heartbeatRenew a claimed job's lease, with its progresssync:write/api/jobs/releaseGive claimed jobs back untouchedsync:write/api/jobs/overviewJobs queue: backlog by status, runner and type; failures; attention; quotasadmin/api/jobsOne group of jobs (status, runner, type, error prefix)admin/api/jobs/{id}/retryRun a job again nowadmin/api/jobs/{id}/cancelCall a job offadmin/api/jobs/bulkRetry or close a whole failure groupadmin/api/items/{id}/video-rehostRegister a rehosted videosync:write/api/items/{id}/captions/punctuatePunctuate machine captionssync:write/api/captions/readable-pendingCaptions waiting for punctuationsync:writePhoto prints (冲印)
Which photos were printed. The Google Photos extension uses its own key; tutu.jiajun.fyi goes through its Access login.
/api/photo-prints待冲印, 待确认 and every print batch with its photosphoto_prints:read/api/photo-printsAdd photos to 待冲印 ({photos: [{mediaKey | publicId, takenAt?, thumbUrl?}]}); status unconfirmed for an album importphoto_prints:write/api/photo-prints/statusWas each photo printed or waiting? (by media key, short id or taken time)photo_prints:read/api/photo-prints/batchesRecord a print batch: date, vendor, size for the chosen photosphoto_prints:write/api/photo-prints/{id}Move a 待确认 photo to 待冲印photo_prints:writeRestaurants (餐厅)
The same record as the public API's /restaurants; agents use that one. Deletes are admin only.
/api/restaurantsList restaurants (?q=&status=want|been&area=&cuisine=&links=unconfirmed|review)restaurants:read/api/restaurants/{id}One restaurant with its linked stores and visitsrestaurants:read/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/api/restaurants/{id}Change fieldsrestaurants:write/api/restaurants/{id}/visitsRecord a visit; the restaurant becomes 去过restaurants:write/api/restaurants/{id}/linksLink another store (关联的店, 已确认)restaurants:write/api/restaurants/{id}/links/{linkId}Confirm a link, mark it 待清洗, or remove itrestaurants:write/api/restaurants/{id}Remove a restaurant recorded by mistake, with its visits, links and reviewsadmin/api/restaurants/visits/{id}Remove one visitadminBooks (读书)
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 (管理 → 设置 → 微信读书).
/api/booksBooks (?status=reading|finished|unread|all&q=&includePrivate=&cursor=&limit=), with counts and sync statebooks:read/api/books/{id}One book: highlights by chapter, thoughts under them, reviewsbooks:read/api/books/highlightsSearch highlights and thoughts (?q=&bookId=)books:read/api/books/statsReading time (?range=week|month|year|total)books:read/api/books/syncSync WeRead now (立即同步)books:write/api/settings/wereadKey status (last four characters only), sync state, countsadmin/api/settings/wereadSave the wrk- key (encrypted) and test itadmin/api/settings/weread/testTest the saved keyadmin/api/settings/wereadRemove the keyadminPeople (人物)
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.
/api/peoplePeople, most items first (?q=&role=&cursor=&limit=)people:read/api/people/{id}One person with their itemspeople:read/api/peopleAdd, or find the one already there by name or aliaspeople:write/api/people/{id}Rename, aliases, description, linkpeople:write/api/people/{id}/mergeFold another person into this one ({personId})people:write/api/people/{id}/itemsLink an item ({itemId, role})people:write/api/people/{id}/items/{itemId}Change the role, or remove the link ({removed: true})people:write/api/people/detectionsImport the backfill's detections (scripts/people-backfill.mjs)admin/api/people/{id}Remove a person recorded by mistake (items stay)adminTodos (待办)
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.
/api/todosTodos: open first by priority and due date (?status=&priority=&tag=&q=&cursor=&limit=)todos:read/api/todosAdd ({title, note?, priority?, dueDate?, tags?})todos:write/api/todos/{id}Change any field, or statustodos:write/api/todos/{id}/completeMark done (also reopen, drop)todos:write/api/todos/reorderHand order ({ids}, first to last)todos:writeAdmin
Owner tools. A key needs admin; backups take the internal token only.
/api/api-keysList API keysadmin/api/api-keysCreate an API key (shown once)admin/api/api-keys/{id}/revokeRevoke a keyadmin/api/api-keys/{id}/callsA key's recent callsadmin/api/agentsThe owner's agents (jiajun.fyi/agent) with their key stateagents:manage/api/agentsCreate an agent and its pih_ key (shown once; never admin, always expires)agents:manage/api/agents/{id}Change an agent's permissions and its key's scopes in placeagents:manage/api/agents/{id}/{action}rotate (new key, same scopes, old revoked) or revokeagents:manage/api/webhooksCallback webhook endpoints (?keyId=)admin/api/webhooksRegister an endpoint for a key (signing secret shown once)admin/api/webhooks/{id}/{action}test, disable, enable, rotate-secret, move (to a new key)admin/api/webhooks/{id}/eventsRecent events with every delivery attemptadmin/api/webhooks/events/{id}/redeliverSend an event againadmin/api/settings/collect-webhookRead, rotate (POST) or disable (DELETE) the collect webhookadmin/api/settings/flomoFlomo settings (PUT, DELETE)admin/api/model-runs/summaryModel cost summaryadmin/api/tikhub/budgetTikHub budget (PUT to change)admin/api/notifications/channelsNotification channelsadmin/api/notifications/sendSend a notificationadmin/api/notifications/logDelivery logadmin/api/system/capabilitiesSystem statusadmin/api/payloadsKeep a raw payloadadmin/api/backup/rowsTable rows for the nightly backupinternal token onlyNo credential
These carry their own proof: a secret in the path, a signature, or a public item.
/healthHealth checknone/api/webhook/collect/{secret}iOS share-sheet collect (GET with ?url= also works)secret in the URL/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/api/public/media/{id}Signed media linksignature/api/public/items/{id}Public fields of an item marked publicnone英语练习
english.jiajun.fyi
英语表达练习、欧路生词本、发音评分、看视频学单词。只认登录;agent 读练习数据走开放 API 的 /english/*。
鉴权Cloudflare Access (owner login)
14 个接口
Practice
/api/english-practicePractice records (POST adds one)login/api/english-practice/{id}Update a record (mastery)login/api/english-practice/sync-stateCursor for the practice sync (PUT moves it)login/api/english-practice/sourcesSource prompts (POST adds)login/api/english-practice/known-termsTerms already masteredloginWords and pronunciation
/api/eudic-wordsWords in a Eudic book, with sync statuslogin/api/eudic-words/starSet a word's masterylogin/api/eudic-words/star-eventsA word's mastery historylogin/api/pronunciation/ttsReference audio for a textlogin/api/pronunciation/attemptsScored attempts (POST scores a new one)login/api/pronunciation/recordingA recorded attemptlogin/api/word-clipsMoments in watched videos where a word is spokenlogin/api/word-clips/clip/{id}A sentence cliplogin/api/word-clips/media/{id}The full media filelogin菜谱
recipes.jiajun.fyi
从收藏里整理出的菜谱、本周排餐和采购清单。只认登录。
鉴权Cloudflare Access (owner login)
9 个接口
/api/recipesAll recipeslogin/api/recipes/{n}One recipelogin/api/recipes/{n}/wantMark as want to cooklogin/api/recipes/{n}/cookedLog that it was cookedlogin/api/items/{id}/recipesRecipes cut from one library itemlogin/api/planThe week's meal plan (POST adds, DELETE /api/plan/{n} removes)login/api/groceryThe week's grocery list (POST adds, DELETE /api/grocery/{n} removes)login/api/grocery/checkTick grocery itemslogin/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 个接口
/api/evaluationsAll evaluations (POST imports one, upsert by slug)login/api/evaluations/{slug}One evaluation with its samples and fileslogin/api/evaluations/{slug}/files/{name}Store a raw file in R2 (GET reads it back)login/api/test-setsTest sets (POST saves one)login/api/test-sets/{slug}One test set and the evaluations run on itlogin/api/test-sets/candidatesLibrary items that could join a test setloginCaltrain 通勤
caltrain.jiajun.fyi
实时 Caltrain 班次和通勤提醒。/status 公开可读;设置页要登录。
鉴权None for /status; /settings behind Cloudflare Access; /api/action takes the hub's internal token
6 个接口
/statusLive train predictions (JSON); with ?from=&to= station ids, any station pair from the timetablenone/stationsStation ids and names, north to southnone/passingsWhen commute trains really left the two boarding platforms (last 30 days)none/healthHealth checknone/settingsReminder settings (?format=json; POST saves)login/api/actionButton actions from the Feishu botinternal token其他
hub.jiajun.fyi:信息库网页(需登录)。它的 /api 就是上面的内部接口,经它转发。api.jiajun.fyi:家里推理机的媒体网关(转写、对话模型、代抓网页)。用自己的密钥,给信息库的后台任务用,不给 agent。suanming.jiajun.fyi:算命数据台:内容库、爬取任务、排盘(需登录)。/api 只给自己的页面用,不发 API 密钥。jiajun.fyi:所有服务的导航页(需登录)。admin.jiajun.fyi:信息库的管理站(只有本人能登录)。它的 /api 就是上面的内部接口,经它转发。