---
canonical_url: "https://docs.composio.dev/toolkits/cometapi"
markdown_url: "https://docs.composio.dev/toolkits/cometapi.md"
product: "platform"
version: null
last_updated: null
---

# CometAPI

CometAPI provides a unified API gateway for text, image, audio, video, and other generative AI models from multiple providers.

- **Category:** ai models
- **Auth:** API_KEY
- **Composio-managed OAuth available?** N/A
- **Tools:** 6
- **Triggers:** 0
- **Slug:** `COMETAPI`
- **Version:** 00000000_00

## Tools

### Create Chat Completion

**Slug:** `COMETAPI_CREATE_CHAT_COMPLETION`

Create a non-streaming Chat Completions result for message-based conversations and function-calling workflows. Use this for models or integrations that require the OpenAI Chat Completions protocol. Requires funded organization balance.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `stop` | string | No | One or more stop sequences, up to the provider's limit of four. |
| `user` | string | No | Stable, non-sensitive end-user identifier for abuse monitoring. |
| `model` | string | Yes | Model ID from the List Models tool with openai in supported_endpoint_types. |
| `tools` | array | No | Function tools the model may call. |
| `top_p` | number | No | Nucleus sampling value from 0 to 1. Omit unless needed; do not tune together with temperature. |
| `messages` | array | Yes | Conversation messages in order. |
| `temperature` | number | No | Sampling temperature from 0 to 2. Omit unless needed; do not tune together with top_p. |
| `tool_choice` | string | No | Tool selection mode or a specific function the model must call. Send it only together with tools; omitted otherwise, leaving the provider default. |
| `response_format` | object | No | Output format configuration for text, JSON mode, or JSON Schema output. |
| `reasoning_effort` | string ("low" | "medium" | "high") | No | Reasoning effort for compatible models. |
| `max_completion_tokens` | integer | No | Maximum generated tokens, including reasoning tokens, for compatible models. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Embeddings

**Slug:** `COMETAPI_CREATE_EMBEDDINGS`

Create OpenAI-compatible embedding vectors for one text or a batch of texts. This metered operation requires funded organization balance.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `user` | string | No | Stable non-sensitive end-user identifier for abuse monitoring. |
| `input` | string | Yes | One text or a batch of texts to embed. Batch results preserve input order. |
| `model` | string | Yes | Embedding model ID, such as text-embedding-3-small. Verify current availability with the List Models tool. |
| `dimensions` | integer | No | Requested vector dimensions for models that support dimensionality reduction. |
| `encoding_format` | string ("float" | "base64") | No | Embedding representation. Use float for numeric vectors or base64 to reduce large response payloads. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Response

**Slug:** `COMETAPI_CREATE_RESPONSE`

Create a non-streaming OpenAI Responses API result. Use this for stateful continuation via previous_response_id, reasoning controls, or structured text output; use Chat Completion for Chat Completions workflows. Requires funded organization balance. Set store=true when a later call will continue from this response.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `text` | object | No | Text output format and verbosity configuration. |
| `input` | string | Yes | Plain text input for the model. |
| `model` | string | Yes | Model ID from the List Models tool that supports the OpenAI-compatible Responses API. |
| `store` | boolean | No | Whether CometAPI should store the response. Set true if its ID will be reused with previous_response_id; defaults to false for data minimization. |
| `top_p` | number | No | Nucleus sampling value from 0 to 1. Do not tune together with temperature. |
| `reasoning` | object | No | Reasoning configuration for compatible models. |
| `truncation` | string ("auto" | "disabled") | No | Context overflow behavior: fail when disabled or drop oldest inputs when auto. |
| `temperature` | number | No | Sampling temperature from 0 to 2. Do not tune together with top_p. |
| `instructions` | string | No | System or developer instructions for this response. |
| `max_output_tokens` | integer | No | Maximum generated tokens, including visible output and reasoning tokens. |
| `previous_response_id` | string | No | Previous response ID for a stateful follow-up. The earlier response must have been created with store=true. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get API Key Usage

**Slug:** `COMETAPI_GET_API_KEY_USAGE`

Return quota, usage, expiration, and model restrictions for the connected CometAPI API key. This reports key-level limits, not the organization's spendable balance or commercial tier.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Models

**Slug:** `COMETAPI_LIST_MODELS`

List all models available to the connected API key, including provider ownership and supported protocol types when returned. Use this before generation to choose a compatible model; catalog presence does not guarantee funded execution.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Moderate Content

**Slug:** `COMETAPI_MODERATE_CONTENT`

Classify one text or a batch of texts with an OpenAI-compatible moderation model. This text-only operation is metered and requires funded CometAPI organization balance.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `input` | string | Yes | One text or a batch of texts to classify. Batch results preserve input order. |
| `model` | string | No | Moderation model ID. The documented default for text is omni-moderation-latest. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
