Docs / Developers and AI

Integrations

Guides for calling OneSend from AI agents and automation tools. Each one uses the REST API with an OneSend API key; nothing here needs a package from npm or PyPI.

GuideContents
Vercel AI SDKsend_email and search_inbox tools for generateText and streamText
LangChain (Python)Tools built on the Python SDK in packages/sdk-python
n8nThe HTTP Request node, credentials, and SMTP as an alternative
Function calling JSON schemaProvider-neutral tool definitions for any model API that accepts JSON Schema tools

For MCP clients (desktop assistants, IDEs and agents that speak MCP), use the MCP server instead: see MCP.

Before you start

  1. Create an API key under Developers → API keys. Give agents the narrowest permission that works:
    • Sending only for agents that only send.
    • Read only for agents that only search the inbox or read logs.
    • A test key (os_test_…) while you develop: sends are logged with status sandboxed and never delivered. Test keys cannot read the inbox. A test key gets the Sending only permission by default; to read sandboxed emails back (GET /v1/emails), create it with Full access or Read only. It then reads every sandboxed email of the workspace, not only its own.
  2. Keep the key on the server side. Never put it in a browser bundle or a prompt.
  3. Decide what the agent may send. An agent that can call send_email can email anyone; restrict the key to your sender domains (domainIds on the key), check recipients in your tool code, and ask a person to confirm before sending to new recipients.

Text that comes back from the inbox is untrusted input. Pass it to the model as data, and do not let it change who the agent emails or what tools it calls.