← Back to workspace
opptics/1 · HTTPS connector

Connector guide

Opptics gives agents a controlled interface to your product. Host one HTTPS endpoint that wraps your evaluation environment. Your connector can use your API, MCP server, or browser automation internally.

One endpoint, five operations

Requests are JSON POSTs with your connector credential in the Authorization: Bearer header.

1. Advertise capabilities

Request

{
  "protocol": "opptics/1",
  "operation": "manifest"
}

Response

{
  "protocol": "opptics/1",
  "capabilities": [
    {
      "key": "records.create",
      "name": "Create a record",
      "description": "Creates a synthetic record from input.title. Observation: record-created."
    }
  ]
}

2. Provision an isolated environment

Request

{
  "protocol": "opptics/1",
  "operation": "provision",
  "runId": "RUN_ID",
  "expiresAt": 1790863200000
}

Response

{
  "environmentId": "env_example"
}

3. Execute one allowed capability

Request

{
  "protocol": "opptics/1",
  "operation": "execute",
  "runId": "RUN_ID",
  "environmentId": "env_example",
  "capability": "records.create",
  "input": {
    "title": "Synthetic example"
  }
}

Response

{
  "ok": true
}

4. Read back the resulting state

Request

{
  "protocol": "opptics/1",
  "operation": "verify",
  "runId": "RUN_ID",
  "environmentId": "env_example",
  "capability": "records.create"
}

Response

{
  "observed": "record-created",
  "summary": "Read back the synthetic record by its ID."
}

5. Destroy the environment

Request

{
  "protocol": "opptics/1",
  "operation": "destroy",
  "runId": "RUN_ID",
  "environmentId": "env_example"
}

Response

{
  "destroyed": true
}

Connector responsibilities

  • Use a dedicated synthetic environment. Enforce expiry, capability scope, and resource ownership inside your product.
  • Make provision, execute, and destroy idempotent by runId. Destroy must also work by runId alone when provisioning times out. A destroyed run must never be recreated by a late request.
  • Verify by reading state independently from the execute response. Opptics compares the observed string exactly with the contract’s expected string.
  • Return JSON within 15 seconds and 64 KiB. The public HTTPS destination must resolve to public IP addresses on port 443. Redirects are rejected.
  • Document input fields and side effects in capability descriptions. Validate inputs in your connector. Never include secrets or customer data in observations.
  • Allow cleanup after revocation or expiry. Run your own expiry cleanup as a fallback if the control plane is unavailable.

Outside agent quickstart

Discover the contract without credentials. Obtain a scoped token from the vendor before requesting execution.

OPPTICS_API="https://www.opptics.ai/api"

# Public manifest (copy URL from the contract)
curl "$CONTRACT_URL"

# Create an evaluation; reuse requestId only for identical retries
curl "$OPPTICS_API/v1/evaluations" \
  -H "Authorization: Bearer $OPPTICS_AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"contractId":"CONTRACT_ID","requestId":"request_0001","capability":"records.create","input":{"title":"Synthetic example"}}'

# Poll the reportUrl from the 202 response
curl "$REPORT_URL" -H "Authorization: Bearer $OPPTICS_AGENT_TOKEN"

A completed run can contain a failed acceptance check. A failed run means execution or verification could not complete. Cleanup has its own status. Tokens expire after 1–24 hours and can be revoked; reports remain available to the vendor in the workspace.