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
| Pattern | Best for |
|---|---|
OpenAI-style tools flows in OpenAI-compatible clients | agent frameworks and existing OpenAI-based loops |
Gemini-native tools.functionDeclarations | Gemini-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
Structured Outputs
Structured output is a product pattern, not one dedicated AnyInt endpoint. The exact mechanism depends on the compatibility family and model you choose.
Prompt Caching
Prompt caching reduces repeated-context cost and latency when the same prompt segments are reused. In practice, the main work is prompt design: stable prefixes are easier to reuse than constantly changing prompts.