Client Usage

Call agents via the Reminix API

Call deployed agents from your Python application.

Invoke an Agent

import asyncio
from reminix.client import Client

async def main():
    async with Client(api_key="reminix_sk_...") as client:
        result = await client.agents.invoke(
            "my-agent",
            input={"name": "World"}
        )
        print(result.output)  # "Hello, World!"

asyncio.run(main())

Chat with an Agent

async def main():
    async with Client(api_key="reminix_sk_...") as client:
        response = await client.agents.chat(
            "my-agent",
            messages=[
                {"role": "user", "content": "Hello!"}
            ]
        )
        print(response.message.content)

Multi-turn Conversation

async def main():
    async with Client(api_key="reminix_sk_...") as client:
        messages = []

        # First turn
        messages.append({"role": "user", "content": "Hello!"})
        response = await client.agents.chat("my-agent", messages=messages)
        messages.append({"role": "assistant", "content": response.message.content})

        # Second turn
        messages.append({"role": "user", "content": "How are you?"})
        response = await client.agents.chat("my-agent", messages=messages)
        print(response.message.content)

Get Project Info

async def main():
    async with Client(api_key="reminix_sk_...") as client:
        project = await client.project.get()
        print(f"Project: {project.name}")

Error Handling

from reminix.client import (
    Client,
    AuthenticationError,
    APIError,
    NetworkError,
)

async def main():
    try:
        async with Client(api_key="reminix_sk_...") as client:
            result = await client.agents.invoke("my-agent", input={})
    except AuthenticationError:
        print("Invalid API key")
    except APIError as e:
        print(f"API error: {e.status} - {e.message}")
    except NetworkError:
        print("Network error")

Common Errors

ErrorCause
AuthenticationErrorInvalid or missing API key
APIError (404)Agent not found
APIError (400)Invalid request
NetworkErrorConnection failed

Next Steps

On this page