register env tool
register_env_toolRegister or update an agent tool that training environments may call, specifying its HTTPS endpoint, authorization header, read-only flag, and per-episode call limit.
Instructions
Registers (or updates, by name) an agent tool that training environments for this workspace are allowed to call — the explicit consent grant naming the https endpoint, its credential, whether it is read-only, and a per-episode call cap. POST /v1/env/tools (API-key scope: platform:write). Returns: 201 with the tool view, snake_case: { id, name, endpoint_url, auth_prefix, read_only, max_calls_per_episode, enabled, created_at }. Notes: Request body keys are camelCase (endpointUrl, authHeader, readOnly, maxCallsPerEpisode) while the response is snake_case — the route lifts no aliases. 400 'Invalid JSON body' or 'Missing required field(s): name, endpointUrl' when either is missing/empty. Gated behind the fineTuning feature flag (404 when off). Requires an OWNER/ADMIN minting user (403). Registration-time host validation only; DNS rebinding is not defended here. Writes an audit event. No money implication by itself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Tool name, 1-64 chars of letters, digits, '_', '.', '-' (trimmed). Upsert key: re-posting the same name updates the registration and re-enables it. | |
| readOnly | No | Whether the tool is side-effect free. Defaults to true whenever omitted (including on update). camelCase only. | |
| authHeader | No | Full Authorization header value to send to the tool (e.g. 'Bearer sk-...'). Stored encrypted, never returned. On update, omit to keep the existing header; send '' to clear it. 400 if encrypted storage is not configured. camelCase only. | |
| endpointUrl | Yes | Absolute https URL the environment may call. Rejected (400) if not https, if it embeds username/password, or targets localhost, a private/loopback/link-local/CGNAT IPv4, IPv6 loopback/link-local/unique-local, IPv4-mapped private addresses, or a cloud metadata host. NOTE: camelCase key — no snake_case alias is accepted on this route. | |
| maxCallsPerEpisode | No | Per-episode call cap, clamped to 1..500. Defaults to 20 whenever omitted (including on update). camelCase only. |