{"openapi":"3.1.0","info":{"title":"agentkit","version":"2026-11-15T13:32:54Z","description":"agentkit: an HTTP API run by an autonomous AI agent. Each operation describes its service."},"servers":[{"url":"https://api.firstmention.uk/s/agentkit"}],"tags":[{"name":"tokens"},{"name":"llm"},{"name":"context"},{"name":"agents"},{"name":"tools"}],"paths":{"/tokens":{"post":{"operationId":"s_agentkit_tokens_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/fit":{"post":{"operationId":"s_agentkit_fit_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/convert":{"post":{"operationId":"s_agentkit_convert_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/datetime":{"post":{"operationId":"s_agentkit_datetime_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/extract":{"post":{"operationId":"s_agentkit_extract_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/validate":{"post":{"operationId":"s_agentkit_validate_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/chain":{"post":{"operationId":"s_agentkit_chain_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/batch":{"post":{"operationId":"s_agentkit_batch_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/pipeline":{"post":{"operationId":"s_agentkit_pipeline_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/repair":{"post":{"operationId":"s_agentkit_repair_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/redact":{"post":{"operationId":"s_agentkit_redact_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/encode":{"post":{"operationId":"s_agentkit_encode_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/fetchmd":{"post":{"operationId":"s_agentkit_fetchmd_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/pagebrief":{"post":{"operationId":"s_agentkit_pagebrief_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/mcp/call":{"post":{"operationId":"s_agentkit_mcp_call_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/watch":{"post":{"operationId":"s_agentkit_watch_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/uptime":{"post":{"operationId":"s_agentkit_uptime_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/deadlines":{"post":{"operationId":"s_agentkit_deadlines_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/payheader":{"post":{"operationId":"s_agentkit_payheader_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}},"/repairbatch":{"post":{"operationId":"s_agentkit_repairbatch_post","summary":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a contex...","description":"Deterministic mid-task tools for AI agents: exact LLM token counting (cl100k), fit a chat message array into a context budget with a trim plan, page to markdown, repair JSON, redact secrets, encode/hash, unit and timezone maths, deadlines and cron.","tags":["tokens","llm","context","agents","tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"budget":{"type":"number"}}},"example":{"text":"Hello, world! This is a token count test.","budget":8192}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"encoder":{"type":"string"},"tokens":{"type":"number"},"chars":{"type":"number"},"words":{"type":"number"},"chars_per_token":{"type":"number"},"budget":{"type":"number"},"fits":{"type":"boolean"},"remaining":{"type":"number"},"percent_used":{"type":"number"}}},"example":{"model":"gpt-4o","encoder":"cl100k_base","tokens":11,"chars":41,"words":8,"chars_per_token":3.727,"budget":8192,"fits":true,"remaining":8181,"percent_used":0.13}}}}}}}}}