AnyInt Docs
Guides

Tool Calling

AnyInt supports tool-oriented workflows through provider-compatible patterns rather than one universal internal schema.

AnyInt supports tool-oriented workflows through provider-compatible patterns rather than one universal internal schema.

Current documented patterns

PatternBest for
OpenAI-style tools flows in OpenAI-compatible clientsagent frameworks and existing OpenAI-based loops
Gemini-native tools.functionDeclarationsGemini-native integrations that want exact provider semantics

Gemini-native example

curl https://gateway.api.anyint.ai/gemini/v1beta/models/gemini-2.0-flash:generateContent \
  -H "Authorization: Bearer $ANYINT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [
          {"text": "What is the temperature in London?"}
        ]
      }
    ],
    "tools": [
      {
        "functionDeclarations": [
          {
            "name": "get_current_temperature",
            "description": "Gets the current temperature for a given location.",
            "parameters": {
              "type": "object",
              "properties": {
                "location": {
                  "type": "string",
                  "description": "The city name, e.g. San Francisco"
                }
              },
              "required": ["location"]
            }
          }
        ]
      }
    ]
  }'

Practical guidance

  • keep tool names stable and descriptive
  • validate every tool argument before execution
  • return tool results in a shape the model can consume reliably
  • log both the tool request and tool result for debugging

How to choose a pattern

  • If your application already uses an OpenAI agent loop, stay on the OpenAI-compatible side
  • If you are building around Gemini-native tools, use the Gemini route directly
  • Do not mix request shapes across provider families inside one call path

On this page