Get startedAPI referenceGoing to productionExplore models

Capabilities

Tool calling

Provide JSON-schema function definitions with tools. PicoX translates tool definitions, tool choices, calls, and tool-result history across Chat Completions, Responses, Messages, and Bedrock Converse.

Function definition
{
  "model": "pico-chat-1",
  "messages": [{"role": "user", "content": "What is the weather in Shanghai?"}],
  "tools": [{
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "Get current weather for a city",
      "parameters": {
        "type": "object",
        "properties": {"city": {"type": "string"}},
        "required": ["city"]
      }
    }
  }]
}

Complete the tool loop

The model returns a tool call; your application executes the function. Validate arguments, append the assistant tool call and the matching tool result, then request the next response. Never execute untrusted tool arguments without validation.

Tool result
{
  "role": "tool",
  "tool_call_id": "call_example",
  "content": "{\"temperature_c\":22}"
}
Copied