Skip to content

Docs: using AI/ML API with Composio's OpenAI-compatible provider #3602

Description

@D1m7asis

Summary

AI/ML API exposes an OpenAI-compatible endpoint at https://api.aimlapi.com/v1, so Composio users can already use it with the existing OpenAI provider wrappers (@composio/openai / composio_openai) by configuring the OpenAI SDK client with a custom baseURL.

I would like to contribute a small docs/cookbook PR showing the supported setup path, rather than adding a new provider package or changing Composio core runtime.

Previous request: #1608 was closed by the stale bot without maintainer feedback.

Why this fits Composio

  • Composio provider packages adapt tools to agent/framework tool-calling formats.
  • AI/ML API is OpenAI-compatible, so the existing OpenAI provider format should be reused.
  • A docs-first integration avoids a duplicate provider package and keeps the runtime surface unchanged.
  • Users get a concrete setup path for routing Composio tool-calling agents through AI/ML API.

Proposed minimal scope

Add a short guide or cookbook covering TypeScript and Python:

  • env vars:
    • COMPOSIO_API_KEY
    • AIMLAPI_API_KEY
  • base URL: https://api.aimlapi.com/v1
  • chat-completions path using OpenAIProvider
  • optional responses path only if currently compatible with the target model/API shape
  • example model: openai/gpt-4o-mini or another stable AI/ML API chat model

Example TypeScript shape:

import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIProvider } from '@composio/openai';

const composio = new Composio({
  apiKey: process.env.COMPOSIO_API_KEY,
  provider: new OpenAIProvider(),
});

const client = new OpenAI({
  apiKey: process.env.AIMLAPI_API_KEY,
  baseURL: 'https://api.aimlapi.com/v1',
});

Questions

  1. Would maintainers prefer this as a provider docs page, a cookbook, or an example under docs/examples?
  2. Should the first PR be chat-completions only to keep the scope low-risk?
  3. Is there any Composio convention for documenting OpenAI-compatible gateways that should be followed?

I can prepare the PR if this scope fits the project direction.

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions