Skill Tracer
Skills › Scientific Agent Skills › autoskill › api-contracts.md

api-contracts.md

113 lines · skills/autoskill/references/api-contracts.md at 5f2bc03

Open on GitHub
1# Autoskill API contract review
2
3Reviewed 2026-09-30. These adapters consume a user's already configured services.
4No Screenpipe history was read during maintenance. Tests use invented events,
5mock transports, and an ephemeral loopback HTTP fixture. Provider docs and
6upstream source checks are not authenticated production verification.
7

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 7
8## Screenpipe
9
10Source snapshot: [screenpipe 1e77db8](https://github.com/screenpipe/screenpipe/tree/1e77db8243b6f774d5ba816ca7b2c4e909e24eba), specifically
11[search](https://github.com/screenpipe/screenpipe/blob/1e77db8243b6f774d5ba816ca7b2c4e909e24eba/crates/screenpipe-engine/src/routes/search.rs),
12[auth middleware](https://github.com/screenpipe/screenpipe/blob/1e77db8243b6f774d5ba816ca7b2c4e909e24eba/crates/screenpipe-engine/src/server.rs), and
13[CLI arguments](https://github.com/screenpipe/screenpipe/blob/1e77db8243b6f774d5ba816ca7b2c4e909e24eba/crates/screenpipe-engine/src/cli/mod.rs).
14The generated [search reference](https://docs.screenpipe.com/api-reference/search/search-screen-and-audio-content)
15is useful but lags source for newer query options. No daemon release was installed,
16started, built, or queried in this review.
18- `GET /search`: `start_time`, `end_time`, `limit`, `offset`; JSON `data[]` with
19 tagged `{type, content}` records and `pagination.{limit,offset,total}`.
20 Autoskill requests `content_type=all`; advances by the raw row count, including
21 skipped rows, until the total is reached. A fixed historical end time reduces
22 drift, but limit/offset pagination is not an atomic snapshot; capture, backfill,
23 or deletions can still change a running query. Narrow and rerun inconsistent windows.
24- Explicit `include_cloud=false`, `include_frames=false`, `filter_pii=false` keep
25 this query from requesting cloud results, images, or remote PII processing.
26 Source describes `filter_pii` as enclave-backed, so do not enable it to achieve
27 a supposedly local redaction pass. Already synced records present in the local
28 database may still be searchable; configure Screenpipe itself separately.
29- OCR/UI records use `timestamp`, `app_name`, `window_name`, `text`; input rows
30 use `window_title`/`text_content`; audio can use `transcription` and has no app.
31 Null optional strings normalize to empty strings. Memory records have creation
32 times rather than activity timestamps; they and other non-timeline variants
33 are skipped with a warning, not treated as screen sessions.
34- Auth-enabled `/search` requires `Authorization: Bearer <local API token>`,
35 including loopback. CLI comments about an unconditional localhost exemption
36 are stale relative to actual middleware. `screenpipe auth token` resolves the
37 local API key, not the separate cloud-session JWT. Some older/custom daemons
38 can disable authentication; the client can omit its token in that case.
39- `GET /health` is public. `doctor` checks reachability only and never probes
40 `/search`; it does not prove credentials, capture permissions, or event flow.
41- Capture exclusions use repeated `--ignored-windows` substring patterns,
42 optionally `App::Title`. The bundled YAML is a checklist, not a daemon config.
43 Do not claim that the prior invented `ignored_apps`/`content_types` keys or
44 wildcard-wrapped titles protect captured data.

Screenpipe

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; JSON data[] with tagged {type, content} records and pagination.{limit,offset,total}. Autoskill requests content_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=false keep this query from requesting cloud results, images, or remote PII processing. Source describes filter_pii as 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 use window_title/text_content; audio can use transcription and 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 /search requires Authorization: Bearer <local API token>, including loopback. CLI comments about an unconditional localhost exemption are stale relative to actual middleware. screenpipe auth token resolves 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 /health is public. doctor checks reachability only and never probes /search; it does not prove credentials, capture permissions, or event flow.
  • Capture exclusions use repeated --ignored-windows substring patterns, optionally App::Title. The bundled YAML is a checklist, not a daemon config. Do not claim that the prior invented ignored_apps/content_types keys or wildcard-wrapped titles protect captured data.
Raw lines 8 to 45
46## LM Studio
48[Chat Completions](https://lmstudio.ai/docs/developer/openai-compat/chat-completions),
49[model list](https://lmstudio.ai/docs/developer/openai-compat/models),
50[authentication](https://lmstudio.ai/docs/developer/core/authentication),
51[model loading](https://lmstudio.ai/docs/cli/local-models/load).
53- Base `http://localhost:1234/v1`; `POST /chat/completions` appends to that base
54 (actual path `/v1/chat/completions`). Body includes the exact server model ID,
55 one user message, and `stream=false`; read `choices[0].message.content`.
56 Truncated, tool-call, non-text, or missing/null `finish_reason` responses fail
57 instead of becoming drafts.
58- LM Studio 0.4.0+ can require `Authorization: Bearer <API token>`.
59 Set `LM_API_TOKEN` for both `/models` preflight and chat calls.
60- `GET /v1/models` returns `data[].id`. With JIT loading, listed models need not
61 be loaded. `doctor` verifies visibility of the selected ID, not generation,
62 available memory, context capacity, or completion quality.
63- `lms load` and `lms server start` are separate actions. The `autoskill-local`
64 identifier is a user-assigned alias, not a claim that a model was installed.
65 Choosing another model or a smaller context is a user setup decision.

LM Studio

Chat Completions, model list, authentication, model loading.

  • Base http://localhost:1234/v1; POST /chat/completions appends to that base (actual path /v1/chat/completions). Body includes the exact server model ID, one user message, and stream=false; read choices[0].message.content. Truncated, tool-call, non-text, or missing/null finish_reason responses fail instead of becoming drafts.
  • LM Studio 0.4.0+ can require Authorization: Bearer <API token>. Set LM_API_TOKEN for both /models preflight and chat calls.
  • GET /v1/models returns data[].id. With JIT loading, listed models need not be loaded. doctor verifies visibility of the selected ID, not generation, available memory, context capacity, or completion quality.
  • lms load and lms server start are separate actions. The autoskill-local identifier 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.
Raw lines 46 to 66
67## Anthropic and Microsoft Foundry
69[Messages](https://platform.claude.com/docs/en/api/messages/create),
70[model lifecycle](https://platform.claude.com/docs/en/about-claude/model-deprecations),
71[Foundry API](https://learn.microsoft.com/en-us/azure/foundry/foundry-models/how-to/use-foundry-models-claude).
73- Anthropic: `POST https://api.anthropic.com/v1/messages`, `x-api-key`,
74 `anthropic-version: 2023-06-01`, JSON `model`, `max_tokens=4096`, `messages`.
75 Opus 4.7 remains an active model in the reviewed lifecycle table; this review
76 does not silently migrate the user's configured model.
77- Responses contain typed `content` blocks, potentially including thinking.
78 Collect only `type=text` blocks, preserving their order. Reject non-final stop
79 reasons (including `max_tokens`, `tool_use`, and `pause_turn`), missing/null
80 `stop_reason`, and empty text. Non-streaming replies require a final stop reason.
81 A normal stop is still not proof that generated SKILL.md satisfies the spec.
82- Foundry API-key mode uses base
83 `https://<resource>.services.ai.azure.com/anthropic`, appending `/v1/messages`;
84 same `x-api-key` and version header. `model` means deployment name. Generic
85 gateways must implement this contract. No OpenAI-style endpoint is implied.
86 Entra bearer acquisition is not implemented; Entra-only models are unsupported
87 by this adapter. Cloud `doctor` checks configuration/key presence only.
88- Requests are synchronous, single-response calls, so there is no completion
89 pagination. HTTP failures propagate without automatic paid retries. No paid
90 requests or real credentials were used to verify these adapters.

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, JSON model, 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 content blocks, potentially including thinking. Collect only type=text blocks, preserving their order. Reject non-final stop reasons (including max_tokens, tool_use, and pause_turn), missing/null stop_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; same x-api-key and version header. model means 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. Cloud doctor checks 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.
Raw lines 67 to 91
92## Local embeddings and TLS
94[SentenceTransformer API](https://sbert.net/docs/package_reference/sentence_transformer/model.html)
95was checked against sentence-transformers 6.1.0 release metadata. Construction
96accepts `local_files_only`; `encode(str)` returns an embedding usable by the
97existing cosine ranking. The
98[all-MiniLM-L6-v2 model card](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
99documents 384 dimensions and truncation at 256 word pieces. Runtime tests use a
100stub embedder; no learned weights or scientific matching quality were validated.
101The index now parses YAML so folded descriptions and nested credential metadata
102do not replace the skill's top-level name/description.
104HTTPX 0.28.1 uses verified HTTPS and accepts `SSL_CERT_FILE` for a custom CA.
105[Caddy local HTTPS](https://caddyserver.com/docs/automatic-https) does not guarantee
106its CA is trusted by every Python environment. See [proxy setup](https-proxy.md).
108The final-response checks also follow the provider SDK schemas:
109[Anthropic Message](https://github.com/anthropics/anthropic-sdk-python/blob/main/src/anthropic/types/message.py)
110requires a non-null stop reason outside streaming; the
111[Chat Completion choice schema](https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion.py)
112requires a finish reason. Missing fields in mocks are not evidence of a valid
113finished production response.

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