api-contracts.md
113 lines · skills/autoskill/references/api-contracts.md at 5f2bc03
Autoskill API contract review
Reviewed 2026-09-30. These adapters consume a user's already configured services. No Screenpipe history was read during maintenance. Tests use invented events, mock transports, and an ephemeral loopback HTTP fixture. Provider docs and upstream source checks are not authenticated production verification.
Raw lines 1 to 7Screenpipe
Source snapshot: screenpipe 1e77db8, specifically search, auth middleware, and CLI arguments. The generated search reference is useful but lags source for newer query options. No daemon release was installed, started, built, or queried in this review.
GET /search:start_time,end_time,limit,offset; JSONdata[]with tagged{type, content}records andpagination.{limit,offset,total}. Autoskill requestscontent_type=all; advances by the raw row count, including skipped rows, until the total is reached. A fixed historical end time reduces drift, but limit/offset pagination is not an atomic snapshot; capture, backfill, or deletions can still change a running query. Narrow and rerun inconsistent windows.- Explicit
include_cloud=false,include_frames=false,filter_pii=falsekeep this query from requesting cloud results, images, or remote PII processing. Source describesfilter_piias enclave-backed, so do not enable it to achieve a supposedly local redaction pass. Already synced records present in the local database may still be searchable; configure Screenpipe itself separately. - OCR/UI records use
timestamp,app_name,window_name,text; input rows usewindow_title/text_content; audio can usetranscriptionand has no app. Null optional strings normalize to empty strings. Memory records have creation times rather than activity timestamps; they and other non-timeline variants are skipped with a warning, not treated as screen sessions. - Auth-enabled
/searchrequiresAuthorization: Bearer <local API token>, including loopback. CLI comments about an unconditional localhost exemption are stale relative to actual middleware.screenpipe auth tokenresolves the local API key, not the separate cloud-session JWT. Some older/custom daemons can disable authentication; the client can omit its token in that case. GET /healthis public.doctorchecks reachability only and never probes/search; it does not prove credentials, capture permissions, or event flow.- Capture exclusions use repeated
--ignored-windowssubstring patterns, optionallyApp::Title. The bundled YAML is a checklist, not a daemon config. Do not claim that the prior inventedignored_apps/content_typeskeys or wildcard-wrapped titles protect captured data.
LM Studio
Chat Completions, model list, authentication, model loading.
- Base
http://localhost:1234/v1;POST /chat/completionsappends to that base (actual path/v1/chat/completions). Body includes the exact server model ID, one user message, andstream=false; readchoices[0].message.content. Truncated, tool-call, non-text, or missing/nullfinish_reasonresponses fail instead of becoming drafts. - LM Studio 0.4.0+ can require
Authorization: Bearer <API token>. SetLM_API_TOKENfor both/modelspreflight and chat calls. GET /v1/modelsreturnsdata[].id. With JIT loading, listed models need not be loaded.doctorverifies visibility of the selected ID, not generation, available memory, context capacity, or completion quality.lms loadandlms server startare separate actions. Theautoskill-localidentifier is a user-assigned alias, not a claim that a model was installed. Choosing another model or a smaller context is a user setup decision.
Anthropic and Microsoft Foundry
Messages, model lifecycle, Foundry API.
- Anthropic:
POST https://api.anthropic.com/v1/messages,x-api-key,anthropic-version: 2023-06-01, JSONmodel,max_tokens=4096,messages. Opus 4.7 remains an active model in the reviewed lifecycle table; this review does not silently migrate the user's configured model. - Responses contain typed
contentblocks, potentially including thinking. Collect onlytype=textblocks, preserving their order. Reject non-final stop reasons (includingmax_tokens,tool_use, andpause_turn), missing/nullstop_reason, and empty text. Non-streaming replies require a final stop reason. A normal stop is still not proof that generated SKILL.md satisfies the spec. - Foundry API-key mode uses base
https://<resource>.services.ai.azure.com/anthropic, appending/v1/messages; samex-api-keyand version header.modelmeans deployment name. Generic gateways must implement this contract. No OpenAI-style endpoint is implied. Entra bearer acquisition is not implemented; Entra-only models are unsupported by this adapter. Clouddoctorchecks configuration/key presence only. - Requests are synchronous, single-response calls, so there is no completion pagination. HTTP failures propagate without automatic paid retries. No paid requests or real credentials were used to verify these adapters.
Local embeddings and TLS
SentenceTransformer API was checked against sentence-transformers 6.1.0 release metadata. Construction accepts local_files_only; encode(str) returns an embedding usable by the existing cosine ranking. The all-MiniLM-L6-v2 model card documents 384 dimensions and truncation at 256 word pieces. Runtime tests use a stub embedder; no learned weights or scientific matching quality were validated. The index now parses YAML so folded descriptions and nested credential metadata do not replace the skill's top-level name/description.
HTTPX 0.28.1 uses verified HTTPS and accepts SSL_CERT_FILE for a custom CA. Caddy local HTTPS does not guarantee its CA is trusted by every Python environment. See proxy setup.
The final-response checks also follow the provider SDK schemas: Anthropic Message requires a non-null stop reason outside streaming; the Chat Completion choice schema requires a finish reason. Missing fields in mocks are not evidence of a valid finished production response.
Raw lines 92 to 113