Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions models/cometapi/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INSTALL_METHOD=remote
REMOTE_INSTALL_URL=debug.dify.ai
REMOTE_INSTALL_PORT=5003
REMOTE_INSTALL_KEY=********-****-****-****-************
84 changes: 84 additions & 0 deletions models/cometapi/PRIVACY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Privacy Policy

🛡️ **CometAPI Privacy and Data Protection Policy**

CometAPI takes user privacy and data protection very seriously. This policy details how we collect, use, store, and protect your personal information.

## 1. 💬 AI Model API Interaction Data Protection

We are committed to protecting your data privacy, especially during your interactions with AI models. To ensure this, we:

- **Do not collect user communications with AI models**: We never collect, store, or record any conversation content between you and the AI models, nor will we in the future.

- **Do not save user communications with AI models**: Your communication content is not saved to our servers or databases, ensuring your conversations remain completely private and secure. Additionally, storing hundreds of millions of daily requests would be prohibitively expensive and unsustainable for us.

Through these measures, we ensure that when using our website, you can enjoy a safe and private interactive environment.

## 2. 👤 User Information

### 2.1 💻 Automatically Collected Information

When you visit our website, we may automatically collect the following information:

- Your IP address
- Browser type and version
- Time and date of access
- Pages visited and action records
- Device type and operating system

### 2.2 📝 Information You Provide

We may collect your personal information through the following means:

- Username and email address provided during account registration
- Contact information submitted through online forms, email, or other methods
- Feedback provided when participating in surveys or comments

### 2.3 🔗 Third-Party Login Information

#### 2.3.1 Github Login

With your prior consent, when using Github login, we will collect your Github username and email for account registration and login authorization.

For more information, please refer to the [Github Privacy Policy](https://docs.github.com/en/site-policy/privacy-policies/github-privacy-statement).

#### 2.3.2 Google Login

With your prior consent, when using Google login, we will collect your Google username and email for account registration and login authorization.

For more information, please refer to the [Google Privacy Policy](https://policies.google.com/privacy).

## 3. ✅ Use of Information

We may use the collected information for the following purposes:

- Providing and improving our services
- Personalizing your user experience
- Processing your requests, orders, or transactions
- Sending promotional information, updates, and other relevant communications (you can opt out)
- Monitoring and analyzing website usage to enhance website performance and functionality
- Protecting our rights, property, or safety

## 4. ❌ Information Sharing

We do not sell or rent your personal information to third parties.

## 5. 🔒 Information Security

We implement reasonable technical and organizational measures to protect your personal information from unauthorized access, use, or disclosure. However, no internet transmission or electronic storage method is completely secure, and we cannot guarantee absolute security.

## 6. 🍪 Cookies and Tracking Technologies

We use cookies and similar technologies to enhance user experience, analyze website traffic, and personalize content. You can disable cookies in your browser settings, but this may affect the website's normal functionality.

## 7. 🔄 Changes to Privacy Policy

We may update this Privacy and Data Protection Policy from time to time. Changes will be posted on this page with an updated date. Please review regularly to stay informed of the latest policy.

## 8. 📧 Contact Us

If you have any questions or comments about this Privacy and Data Protection Policy, please contact our customer service through the contact information in the footer of this website.

---

Thank you for your attention to and understanding of our Privacy and Data Protection Policy.
99 changes: 99 additions & 0 deletions models/cometapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# CometAPI
All AI Models in One API - 500+ AI Models

## Overview

CometAPI is a comprehensive AI platform that provides unified access to over 500 cutting-edge AI models through a single, powerful API. Our platform simplifies AI integration by offering a diverse ecosystem of language models, image generation tools, video creation services, and specialized AI capabilities - all accessible through one streamlined interface.

### Key Features

- **🚀 500+ AI Models**: Access to the latest and most powerful AI models including GPT-4, Claude, GLM-4.5, Qwen3-Coder, Kimi K2, Grok 4, and many more
- **🎨 Multi-Modal Capabilities**: Support for text generation, image creation, video production, music composition, and audio processing
- **⚡ Unified API**: Single API endpoint for all AI services, reducing integration complexity
- **🔄 Real-time Access**: Get instant access to newly released AI models as they become available
- **💰 Cost-Effective**: Competitive pricing with flexible usage plans
- **🛡️ Enterprise Ready**: Robust security, reliability, and scalable infrastructure

### Model Support List

The following table shows all LLM model providers supported in CometAPI:

| # | Model Provider | Folder Name | Status | Notes |
|---|----------------|-------------|--------|-------|
| 1 | Anthropic Claude | `anthropic` | ✅ | Claude series |
| 2 | DeepSeek | `deepseek` | ✅ | - |
| 3 | Google Gemini | `gemini` | ✅ | - |
| 4 | Meta Llama | `llama` | ✅ | Meta's Llama models |
| 5 | OpenAI | `openai` | ✅ | GPT series |
| 6 | Qwen | `qwen` | ✅ | Alibaba's Qwen models |
| 7 | X-AI | `x-ai` | ✅ | Grok models |

**Total: 7 LLM Model Providers Supported**
For access to additional models beyond those listed, please visit: [www.cometapi.com](https://www.cometapi.com/)


## Configuration

### Step 1: Get Your API Key(If you don't have a CometAPI key yet)
1. Visit [CometAPI Console](https://api.cometapi.com/console/token)
2. Sign up for a free account (1M free tokens available for new users!)
3. Generate your API key from the dashboard

### Step 2: Setup in Dify
1. Navigate to **Settings** → **Model Provider**
2. Find **CometAPI** in the provider list
3. Enter your API key
4. Save the configuration

### Step 3: Start Using
Once configured, you can access all 500+ AI models through CometAPI's unified interface.

## Quick Start

After installation and configuration, you can immediately start using any of the available AI models:

- Choose from text generation models for content creation
- Use image generation APIs for visual content
- Access video creation tools for multimedia projects
- Leverage specialized coding models for development tasks

## Pricing

CometAPI offers flexible pricing options:
- **Free Tier**: 1M tokens for new users
- **Pay-as-you-go**: Cost-effective usage-based pricing
- **Enterprise Plans**: Custom solutions for large-scale deployments


Visit our [Pricing Page](https://api.cometapi.com/pricing) for detailed information.

## Documentation & Support

- **📚 API Documentation**: [api.cometapi.com/doc](https://api.cometapi.com/doc)
- **🚀 Quick Start Guide**: [api.cometapi.com/panel](https://api.cometapi.com/panel)
- **💬 Discord Community**: [Join our Discord](https://discord.com/invite/HMpuV6FCrG)
- **📧 Email Support**: [support@cometapi.com](mailto:support@cometapi.com)

## Social Links

- **🐦 Twitter**: [@cometapi2025](https://x.com/cometapi2025)
- **💬 Discord**: [Join our Community](https://discord.com/invite/HMpuV6FCrG)


## Why Choose CometAPI?

1. **Comprehensive Coverage**: Access to the most extensive collection of AI models in the industry
2. **Unified Interface**: One API to rule them all - no need to manage multiple providers
3. **Latest Models**: Always up-to-date with the newest AI breakthroughs
4. **Developer Friendly**: Comprehensive documentation and active community support
5. **Reliable Infrastructure**: Enterprise-grade reliability and performance
6. **Competitive Pricing**: Best value for money with transparent pricing

---

**Ready to get started?** [Sign up now](https://api.cometapi.com/login) and claim your free 1M tokens!

For more information, visit our official website: [www.cometapi.com](https://www.cometapi.com/)



Binary file added models/cometapi/_assets/cometapi_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added models/cometapi/_assets/cometapi_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions models/cometapi/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from dify_plugin import Plugin, DifyPluginEnv

plugin = Plugin(DifyPluginEnv(MAX_REQUEST_TIMEOUT=120))

if __name__ == '__main__':
plugin.run()
41 changes: 41 additions & 0 deletions models/cometapi/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: 0.0.1
type: plugin
author: cometapi
name: cometapi
label:
en_US: CometAPI
zh_Hans: CometAPI
ja_JP: CometAPI
pt_BR: CometAPI
description:
en_US: "500+ AI Model API, All In One API. Just In CometAPI."
zh_Hans: "500+ AI 模型 API,一站集成,尽在 CometAPI。"
ja_JP: "500以上のAIモデルAPIを一括提供。すべてはCometAPIに。"
pt_BR: "500+ modelos de IA em uma única API. Tudo em um só lugar : CometAPI."
icon: cometapi_small.png
icon_dark: cometapi_small.png
resource:
memory: 268435456
permission:
model:
enabled: true
llm: true
text_embedding: true
tts: true
speech2text: true
plugins:
models:
- provider/cometapi.yaml
meta:
version: 0.0.1
arch:
- amd64
- arm64
runner:
language: python
version: "3.12"
entrypoint: main
minimum_dify_version: 1.0.0
created_at: 2025-08-05T11:06:28.002855+08:00
privacy: PRIVACY.md
verified: false
49 changes: 49 additions & 0 deletions models/cometapi/models/common_openai.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from collections.abc import Mapping

import openai
from httpx import Timeout

from dify_plugin.errors.model import InvokeAuthorizationError, InvokeBadRequestError, InvokeConnectionError, InvokeError, InvokeRateLimitError, InvokeServerUnavailableError


class _CommonOpenAI:
def _to_credential_kwargs(self, credentials: Mapping) -> dict:
"""
Transform credentials to kwargs for model instance

:param credentials:
:return:
"""
credentials_kwargs = {
"api_key": credentials['api_key'],
"timeout": Timeout(315.0, read=300.0, write=10.0, connect=5.0),
"max_retries": 1,
}

# CometAPI uses fixed base URL
credentials_kwargs["base_url"] = "https://api.cometapi.com/v1"

return credentials_kwargs

@property
def _invoke_error_mapping(self) -> dict[type[InvokeError], list[type[Exception]]]:
"""
Map model invoke error to unified error
The key is the error type thrown to the caller
The value is the error type thrown by the model,
which needs to be converted into a unified error type for the caller.

:return: Invoke error mapping
"""
return {
InvokeConnectionError: [openai.APIConnectionError, openai.APITimeoutError],
InvokeServerUnavailableError: [openai.InternalServerError],
InvokeRateLimitError: [openai.RateLimitError],
InvokeAuthorizationError: [openai.AuthenticationError, openai.PermissionDeniedError],
InvokeBadRequestError: [
openai.BadRequestError,
openai.NotFoundError,
openai.UnprocessableEntityError,
openai.APIError,
],
}
Empty file.
84 changes: 84 additions & 0 deletions models/cometapi/models/llm/_position.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# anthropic models (9)
- claude-3-5-haiku-20241022
- claude-3-5-sonnet-20240620
- claude-3-5-sonnet-20241022
- claude-3-7-sonnet-20250219
- claude-3-haiku-20240307
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- claude-opus-4-20250514
- claude-sonnet-4-20250514

# deepseek models (5)
- deepseek-chat
- deepseek-r1-0528
- deepseek-reasoner
- deepseek-v3
- deepseek-v3-250324

# gemini models (5)
- gemini-2.0-flash
- gemini-2.0-flash-lite-preview-02-05
- gemini-2.5-flash
- gemini-2.5-flash-lite-preview-06-17
- gemini-2.5-pro

# llama models (4)
- llama-3-70b
- llama-3-8b
- llama-4-maverick
- llama-4-scout

# openai models (37)
- chatgpt-4o-latest
- gpt-3.5-turbo
- gpt-3.5-turbo-0125
- gpt-3.5-turbo-1106
- gpt-3.5-turbo-16k
- gpt-3.5-turbo-instruct
- gpt-4
- gpt-4-0125-preview
- gpt-4-1106-preview
- gpt-4-turbo
- gpt-4-turbo-2024-04-09
- gpt-4-turbo-preview
- gpt-4.1
- gpt-4.1-2025-04-14
- gpt-4.1-mini
- gpt-4.1-mini-2025-04-14
- gpt-4.1-nano
- gpt-4.1-nano-2025-04-14
- gpt-4o
- gpt-4o-2024-05-13
- gpt-4o-2024-08-06
- gpt-4o-2024-11-20
- gpt-4o-mini
- gpt-4o-mini-2024-07-18
- o1
- o1-mini
- o1-mini-2024-09-12
- o1-preview
- o1-preview-2024-09-12
- o3
- o3-2025-04-16
- o3-mini
- o3-mini-2025-01-31
- o3-pro
- o3-pro-2025-06-10
- o4-mini
- o4-mini-2025-04-16

# qwen models (5)
- qwen2-72b-instruct
- qwen2.5-72b-instruct
- qwen3-30b-a3b
- qwen3-coder
- qwen3-coder-480b-a35b-instruct

# x-ai models (6)
- grok-2-1212
- grok-3-beta
- grok-3-fast
- grok-3-mini
- grok-3-mini-fast
- grok-4-0709
Loading