mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-25 06:48:12 -05:00
Compare commits
6 Commits
fix/ci-com
...
improvemen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6943735bb2 | ||
|
|
8b05d7cc50 | ||
|
|
a74fbe3225 | ||
|
|
303934f09e | ||
|
|
6a88b591f7 | ||
|
|
a96437b232 |
@@ -105,28 +105,32 @@ Die Modellaufschlüsselung zeigt:
|
|||||||
Die angezeigten Preise entsprechen den Tarifen vom 10. September 2025. Überprüfen Sie die Dokumentation der Anbieter für aktuelle Preise.
|
Die angezeigten Preise entsprechen den Tarifen vom 10. September 2025. Überprüfen Sie die Dokumentation der Anbieter für aktuelle Preise.
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
|
## Bring Your Own Key (BYOK)
|
||||||
|
|
||||||
|
Sie können Ihre eigenen API-Schlüssel für gehostete Modelle (OpenAI, Anthropic, Google, Mistral) unter **Einstellungen → BYOK** verwenden, um Basispreise zu zahlen. Schlüssel werden verschlüsselt und gelten arbeitsbereichsweit.
|
||||||
|
|
||||||
## Strategien zur Kostenoptimierung
|
## Strategien zur Kostenoptimierung
|
||||||
|
|
||||||
- **Modellauswahl**: Wählen Sie Modelle basierend auf der Komplexität der Aufgabe. Einfache Aufgaben können GPT-4.1-nano verwenden, während komplexes Denken möglicherweise o1 oder Claude Opus erfordert.
|
- **Modellauswahl**: Wählen Sie Modelle basierend auf der Aufgabenkomplexität. Einfache Aufgaben können GPT-4.1-nano verwenden, während komplexes Reasoning o1 oder Claude Opus erfordern könnte.
|
||||||
- **Prompt-Engineering**: Gut strukturierte, präzise Prompts reduzieren den Token-Verbrauch ohne Qualitätseinbußen.
|
- **Prompt Engineering**: Gut strukturierte, prägnante Prompts reduzieren den Token-Verbrauch ohne Qualitätsverlust.
|
||||||
- **Lokale Modelle**: Verwenden Sie Ollama oder VLLM für unkritische Aufgaben, um API-Kosten vollständig zu eliminieren.
|
- **Lokale Modelle**: Verwenden Sie Ollama oder VLLM für unkritische Aufgaben, um API-Kosten vollständig zu eliminieren.
|
||||||
- **Caching und Wiederverwendung**: Speichern Sie häufig verwendete Ergebnisse in Variablen oder Dateien, um wiederholte KI-Modellaufrufe zu vermeiden.
|
- **Caching und Wiederverwendung**: Speichern Sie häufig verwendete Ergebnisse in Variablen oder Dateien, um wiederholte AI-Modellaufrufe zu vermeiden.
|
||||||
- **Batch-Verarbeitung**: Verarbeiten Sie mehrere Elemente in einer einzigen KI-Anfrage anstatt einzelne Aufrufe zu tätigen.
|
- **Batch-Verarbeitung**: Verarbeiten Sie mehrere Elemente in einer einzigen AI-Anfrage, anstatt einzelne Aufrufe zu tätigen.
|
||||||
|
|
||||||
## Nutzungsüberwachung
|
## Nutzungsüberwachung
|
||||||
|
|
||||||
Überwachen Sie Ihre Nutzung und Abrechnung unter Einstellungen → Abonnement:
|
Überwachen Sie Ihre Nutzung und Abrechnung unter Einstellungen → Abonnement:
|
||||||
|
|
||||||
- **Aktuelle Nutzung**: Echtzeit-Nutzung und -Kosten für den aktuellen Zeitraum
|
- **Aktuelle Nutzung**: Echtzeit-Nutzung und Kosten für den aktuellen Zeitraum
|
||||||
- **Nutzungslimits**: Plangrenzen mit visuellen Fortschrittsanzeigen
|
- **Nutzungslimits**: Plan-Limits mit visuellen Fortschrittsindikatoren
|
||||||
- **Abrechnungsdetails**: Prognostizierte Gebühren und Mindestverpflichtungen
|
- **Abrechnungsdetails**: Prognostizierte Gebühren und Mindestverpflichtungen
|
||||||
- **Planverwaltung**: Upgrade-Optionen und Abrechnungsverlauf
|
- **Plan-Verwaltung**: Upgrade-Optionen und Abrechnungsverlauf
|
||||||
|
|
||||||
### Programmatische Nutzungsverfolgung
|
### Programmatisches Nutzungs-Tracking
|
||||||
|
|
||||||
Sie können Ihre aktuelle Nutzung und Limits programmatisch über die API abfragen:
|
Sie können Ihre aktuelle Nutzung und Limits programmatisch über die API abfragen:
|
||||||
|
|
||||||
**Endpunkt:**
|
**Endpoint:**
|
||||||
|
|
||||||
```text
|
```text
|
||||||
GET /api/users/me/usage-limits
|
GET /api/users/me/usage-limits
|
||||||
@@ -172,69 +176,69 @@ curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" htt
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Rate-Limit-Felder:**
|
**Rate-Limit-Felder:**
|
||||||
- `requestsPerMinute`: Dauerhafte Rate-Begrenzung (Tokens werden mit dieser Rate aufgefüllt)
|
- `requestsPerMinute`: Dauerhaftes Rate-Limit (Tokens werden mit dieser Rate aufgefüllt)
|
||||||
- `maxBurst`: Maximale Tokens, die Sie ansammeln können (Burst-Kapazität)
|
- `maxBurst`: Maximale Tokens, die Sie akkumulieren können (Burst-Kapazität)
|
||||||
- `remaining`: Aktuell verfügbare Tokens (können bis zu `maxBurst` sein)
|
- `remaining`: Aktuell verfügbare Tokens (kann bis zu `maxBurst` betragen)
|
||||||
|
|
||||||
**Antwortfelder:**
|
**Antwortfelder:**
|
||||||
- `currentPeriodCost` spiegelt die Nutzung in der aktuellen Abrechnungsperiode wider
|
- `currentPeriodCost` spiegelt die Nutzung im aktuellen Abrechnungszeitraum wider
|
||||||
- `limit` wird von individuellen Limits (Free/Pro) oder gepoolten Organisationslimits (Team/Enterprise) abgeleitet
|
- `limit` wird aus individuellen Limits (Free/Pro) oder gepoolten Organisationslimits (Team/Enterprise) abgeleitet
|
||||||
- `plan` ist der aktive Plan mit der höchsten Priorität, der mit Ihrem Benutzer verknüpft ist
|
- `plan` ist der Plan mit der höchsten Priorität, der Ihrem Benutzer zugeordnet ist
|
||||||
|
|
||||||
## Plan-Limits
|
## Plan-Limits
|
||||||
|
|
||||||
Verschiedene Abonnementpläne haben unterschiedliche Nutzungslimits:
|
Verschiedene Abonnement-Pläne haben unterschiedliche Nutzungslimits:
|
||||||
|
|
||||||
| Plan | Monatliches Nutzungslimit | Ratenlimits (pro Minute) |
|
| Plan | Monatliches Nutzungslimit | Ratenlimits (pro Minute) |
|
||||||
|------|-------------------|-------------------------|
|
|------|-------------------|-------------------------|
|
||||||
| **Free** | 20 $ | 5 synchron, 10 asynchron |
|
| **Free** | 20 $ | 5 sync, 10 async |
|
||||||
| **Pro** | 100 $ | 10 synchron, 50 asynchron |
|
| **Pro** | 100 $ | 10 sync, 50 async |
|
||||||
| **Team** | 500 $ (gepoolt) | 50 synchron, 100 asynchron |
|
| **Team** | 500 $ (gemeinsam) | 50 sync, 100 async |
|
||||||
| **Enterprise** | Individuell | Individuell |
|
| **Enterprise** | Individuell | Individuell |
|
||||||
|
|
||||||
## Abrechnungsmodell
|
## Abrechnungsmodell
|
||||||
|
|
||||||
Sim verwendet ein **Basisabonnement + Mehrverbrauch**-Abrechnungsmodell:
|
Sim verwendet ein **Basis-Abonnement + Mehrverbrauch**-Abrechnungsmodell:
|
||||||
|
|
||||||
### Wie es funktioniert
|
### So funktioniert es
|
||||||
|
|
||||||
**Pro-Plan ($20/Monat):**
|
**Pro-Plan (20 $/Monat):**
|
||||||
- Monatliches Abonnement beinhaltet $20 Nutzung
|
- Monatsabonnement beinhaltet 20 $ Nutzung
|
||||||
- Nutzung unter $20 → Keine zusätzlichen Kosten
|
- Nutzung unter 20 $ → Keine zusätzlichen Gebühren
|
||||||
- Nutzung über $20 → Zahlen Sie den Mehrverbrauch am Monatsende
|
- Nutzung über 20 $ → Mehrverbrauch am Monatsende zahlen
|
||||||
- Beispiel: $35 Nutzung = $20 (Abonnement) + $15 (Mehrverbrauch)
|
- Beispiel: 35 $ Nutzung = 20 $ (Abonnement) + 15 $ (Mehrverbrauch)
|
||||||
|
|
||||||
**Team-Plan ($40/Benutzer/Monat):**
|
**Team-Plan (40 $/Platz/Monat):**
|
||||||
- Gepoolte Nutzung für alle Teammitglieder
|
- Gemeinsame Nutzung über alle Teammitglieder
|
||||||
- Mehrverbrauch wird aus der Gesamtnutzung des Teams berechnet
|
- Mehrverbrauch wird aus der gesamten Team-Nutzung berechnet
|
||||||
- Organisationsinhaber erhält eine Rechnung
|
- Organisationsinhaber erhält eine Rechnung
|
||||||
|
|
||||||
**Enterprise-Pläne:**
|
**Enterprise-Pläne:**
|
||||||
- Fester monatlicher Preis, kein Mehrverbrauch
|
- Fester Monatspreis, kein Mehrverbrauch
|
||||||
- Individuelle Nutzungslimits gemäß Vereinbarung
|
- Individuelle Nutzungslimits gemäß Vereinbarung
|
||||||
|
|
||||||
### Schwellenwert-Abrechnung
|
### Schwellenwert-Abrechnung
|
||||||
|
|
||||||
Wenn der nicht abgerechnete Mehrverbrauch $50 erreicht, berechnet Sim automatisch den gesamten nicht abgerechneten Betrag.
|
Wenn der nicht abgerechnete Mehrverbrauch 50 $ erreicht, rechnet Sim automatisch den gesamten nicht abgerechneten Betrag ab.
|
||||||
|
|
||||||
**Beispiel:**
|
**Beispiel:**
|
||||||
- Tag 10: $70 Mehrverbrauch → Sofortige Abrechnung von $70
|
- Tag 10: 70 $ Mehrverbrauch → 70 $ sofort abrechnen
|
||||||
- Tag 15: Zusätzliche $35 Nutzung ($105 insgesamt) → Bereits abgerechnet, keine Aktion
|
- Tag 15: Zusätzliche 35 $ Nutzung (105 $ gesamt) → Bereits abgerechnet, keine Aktion
|
||||||
- Tag 20: Weitere $50 Nutzung ($155 insgesamt, $85 nicht abgerechnet) → Sofortige Abrechnung von $85
|
- Tag 20: Weitere 50 $ Nutzung (155 $ gesamt, 85 $ nicht abgerechnet) → 85 $ sofort abrechnen
|
||||||
|
|
||||||
Dies verteilt große Überziehungsgebühren über den Monat, anstatt eine große Rechnung am Ende des Abrechnungszeitraums zu erhalten.
|
Dies verteilt große Mehrverbrauchsgebühren über den Monat, anstatt einer großen Rechnung am Periodenende.
|
||||||
|
|
||||||
## Best Practices für Kostenmanagement
|
## Best Practices für Kostenmanagement
|
||||||
|
|
||||||
1. **Regelmäßig überwachen**: Überprüfen Sie Ihr Nutzungs-Dashboard häufig, um Überraschungen zu vermeiden
|
1. **Regelmäßig überwachen**: Überprüfen Sie Ihr Nutzungs-Dashboard häufig, um Überraschungen zu vermeiden
|
||||||
2. **Budgets festlegen**: Nutzen Sie Planlimits als Leitplanken für Ihre Ausgaben
|
2. **Budgets festlegen**: Nutzen Sie Plan-Limits als Leitplanken für Ihre Ausgaben
|
||||||
3. **Workflows optimieren**: Überprüfen Sie kostenintensive Ausführungen und optimieren Sie Prompts oder Modellauswahl
|
3. **Workflows optimieren**: Überprüfen Sie kostenintensive Ausführungen und optimieren Sie Prompts oder Modellauswahl
|
||||||
4. **Passende Modelle verwenden**: Passen Sie die Modellkomplexität an die Aufgabenanforderungen an
|
4. **Passende Modelle verwenden**: Passen Sie die Modellkomplexität an die Aufgabenanforderungen an
|
||||||
5. **Ähnliche Aufgaben bündeln**: Kombinieren Sie wenn möglich mehrere Anfragen, um den Overhead zu reduzieren
|
5. **Ähnliche Aufgaben bündeln**: Kombinieren Sie mehrere Anfragen, wenn möglich, um Overhead zu reduzieren
|
||||||
|
|
||||||
## Nächste Schritte
|
## Nächste Schritte
|
||||||
|
|
||||||
- Überprüfen Sie Ihre aktuelle Nutzung unter [Einstellungen → Abonnement](https://sim.ai/settings/subscription)
|
- Überprüfen Sie Ihre aktuelle Nutzung unter [Einstellungen → Abonnement](https://sim.ai/settings/subscription)
|
||||||
- Erfahren Sie mehr über [Protokollierung](/execution/logging), um Ausführungsdetails zu verfolgen
|
- Erfahren Sie mehr über [Protokollierung](/execution/logging), um Ausführungsdetails zu verfolgen
|
||||||
- Erkunden Sie die [Externe API](/execution/api) für programmatische Kostenüberwachung
|
- Entdecken Sie die [externe API](/execution/api) für programmatische Kostenüberwachung
|
||||||
- Sehen Sie sich [Workflow-Optimierungstechniken](/blocks) an, um Kosten zu reduzieren
|
- Sehen Sie sich [Workflow-Optimierungstechniken](/blocks) an, um Kosten zu reduzieren
|
||||||
@@ -105,26 +105,30 @@ El desglose del modelo muestra:
|
|||||||
Los precios mostrados reflejan las tarifas a partir del 10 de septiembre de 2025. Consulta la documentación del proveedor para conocer los precios actuales.
|
Los precios mostrados reflejan las tarifas a partir del 10 de septiembre de 2025. Consulta la documentación del proveedor para conocer los precios actuales.
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
|
## Trae tu propia clave (BYOK)
|
||||||
|
|
||||||
|
Puedes usar tus propias claves API para modelos alojados (OpenAI, Anthropic, Google, Mistral) en **Configuración → BYOK** para pagar precios base. Las claves están encriptadas y se aplican a todo el espacio de trabajo.
|
||||||
|
|
||||||
## Estrategias de optimización de costos
|
## Estrategias de optimización de costos
|
||||||
|
|
||||||
- **Selección de modelos**: Elige modelos según la complejidad de la tarea. Las tareas simples pueden usar GPT-4.1-nano mientras que el razonamiento complejo podría necesitar o1 o Claude Opus.
|
- **Selección de modelo**: elige modelos según la complejidad de la tarea. Las tareas simples pueden usar GPT-4.1-nano mientras que el razonamiento complejo podría necesitar o1 o Claude Opus.
|
||||||
- **Ingeniería de prompts**: Los prompts bien estructurados y concisos reducen el uso de tokens sin sacrificar la calidad.
|
- **Ingeniería de prompts**: los prompts bien estructurados y concisos reducen el uso de tokens sin sacrificar calidad.
|
||||||
- **Modelos locales**: Usa Ollama o VLLM para tareas no críticas para eliminar por completo los costos de API.
|
- **Modelos locales**: usa Ollama o VLLM para tareas no críticas para eliminar completamente los costos de API.
|
||||||
- **Almacenamiento en caché y reutilización**: Guarda resultados frecuentemente utilizados en variables o archivos para evitar llamadas repetidas al modelo de IA.
|
- **Almacenamiento en caché y reutilización**: guarda resultados usados frecuentemente en variables o archivos para evitar llamadas repetidas al modelo de IA.
|
||||||
- **Procesamiento por lotes**: Procesa múltiples elementos en una sola solicitud de IA en lugar de hacer llamadas individuales.
|
- **Procesamiento por lotes**: procesa múltiples elementos en una sola solicitud de IA en lugar de hacer llamadas individuales.
|
||||||
|
|
||||||
## Monitoreo de uso
|
## Monitoreo de uso
|
||||||
|
|
||||||
Monitorea tu uso y facturación en Configuración → Suscripción:
|
Monitorea tu uso y facturación en Configuración → Suscripción:
|
||||||
|
|
||||||
- **Uso actual**: Uso y costos en tiempo real para el período actual
|
- **Uso actual**: uso y costos en tiempo real para el período actual
|
||||||
- **Límites de uso**: Límites del plan con indicadores visuales de progreso
|
- **Límites de uso**: límites del plan con indicadores visuales de progreso
|
||||||
- **Detalles de facturación**: Cargos proyectados y compromisos mínimos
|
- **Detalles de facturación**: cargos proyectados y compromisos mínimos
|
||||||
- **Gestión del plan**: Opciones de actualización e historial de facturación
|
- **Gestión de plan**: opciones de actualización e historial de facturación
|
||||||
|
|
||||||
### Seguimiento programático de uso
|
### Seguimiento de uso programático
|
||||||
|
|
||||||
Puedes consultar tu uso actual y límites de forma programática utilizando la API:
|
Puedes consultar tu uso y límites actuales de forma programática usando la API:
|
||||||
|
|
||||||
**Endpoint:**
|
**Endpoint:**
|
||||||
|
|
||||||
@@ -135,13 +139,13 @@ GET /api/users/me/usage-limits
|
|||||||
**Autenticación:**
|
**Autenticación:**
|
||||||
- Incluye tu clave API en el encabezado `X-API-Key`
|
- Incluye tu clave API en el encabezado `X-API-Key`
|
||||||
|
|
||||||
**Ejemplo de solicitud:**
|
**Solicitud de ejemplo:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
|
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
|
||||||
```
|
```
|
||||||
|
|
||||||
**Ejemplo de respuesta:**
|
**Respuesta de ejemplo:**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -172,14 +176,14 @@ curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" htt
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Campos de límite de tasa:**
|
**Campos de límite de tasa:**
|
||||||
- `requestsPerMinute`: Límite de tasa sostenida (los tokens se recargan a esta velocidad)
|
- `requestsPerMinute`: límite de tasa sostenida (los tokens se recargan a esta tasa)
|
||||||
- `maxBurst`: Máximo de tokens que puedes acumular (capacidad de ráfaga)
|
- `maxBurst`: tokens máximos que puedes acumular (capacidad de ráfaga)
|
||||||
- `remaining`: Tokens disponibles actualmente (puede ser hasta `maxBurst`)
|
- `remaining`: tokens actuales disponibles (puede ser hasta `maxBurst`)
|
||||||
|
|
||||||
**Campos de respuesta:**
|
**Campos de respuesta:**
|
||||||
- `currentPeriodCost` refleja el uso en el período de facturación actual
|
- `currentPeriodCost` refleja el uso en el período de facturación actual
|
||||||
- `limit` se deriva de límites individuales (Gratuito/Pro) o límites agrupados de la organización (Equipo/Empresa)
|
- `limit` se deriva de límites individuales (Free/Pro) o límites de organización agrupados (Team/Enterprise)
|
||||||
- `plan` es el plan activo de mayor prioridad asociado a tu usuario
|
- `plan` es el plan activo de mayor prioridad asociado con tu usuario
|
||||||
|
|
||||||
## Límites del plan
|
## Límites del plan
|
||||||
|
|
||||||
@@ -187,10 +191,10 @@ Los diferentes planes de suscripción tienen diferentes límites de uso:
|
|||||||
|
|
||||||
| Plan | Límite de uso mensual | Límites de tasa (por minuto) |
|
| Plan | Límite de uso mensual | Límites de tasa (por minuto) |
|
||||||
|------|-------------------|-------------------------|
|
|------|-------------------|-------------------------|
|
||||||
| **Gratis** | $20 | 5 síncronas, 10 asíncronas |
|
| **Gratuito** | $20 | 5 sync, 10 async |
|
||||||
| **Pro** | $100 | 10 síncronas, 50 asíncronas |
|
| **Pro** | $100 | 10 sync, 50 async |
|
||||||
| **Equipo** | $500 (compartido) | 50 síncronas, 100 asíncronas |
|
| **Equipo** | $500 (compartido) | 50 sync, 100 async |
|
||||||
| **Empresarial** | Personalizado | Personalizado |
|
| **Empresa** | Personalizado | Personalizado |
|
||||||
|
|
||||||
## Modelo de facturación
|
## Modelo de facturación
|
||||||
|
|
||||||
@@ -200,16 +204,16 @@ Sim utiliza un modelo de facturación de **suscripción base + excedente**:
|
|||||||
|
|
||||||
**Plan Pro ($20/mes):**
|
**Plan Pro ($20/mes):**
|
||||||
- La suscripción mensual incluye $20 de uso
|
- La suscripción mensual incluye $20 de uso
|
||||||
- Uso por debajo de $20 → Sin cargos adicionales
|
- Uso inferior a $20 → Sin cargos adicionales
|
||||||
- Uso por encima de $20 → Pagas el excedente al final del mes
|
- Uso superior a $20 → Paga el excedente al final del mes
|
||||||
- Ejemplo: $35 de uso = $20 (suscripción) + $15 (excedente)
|
- Ejemplo: $35 de uso = $20 (suscripción) + $15 (excedente)
|
||||||
|
|
||||||
**Plan de Equipo ($40/usuario/mes):**
|
**Plan Equipo ($40/usuario/mes):**
|
||||||
- Uso agrupado entre todos los miembros del equipo
|
- Uso compartido entre todos los miembros del equipo
|
||||||
- Excedente calculado del uso total del equipo
|
- El excedente se calcula a partir del uso total del equipo
|
||||||
- El propietario de la organización recibe una sola factura
|
- El propietario de la organización recibe una sola factura
|
||||||
|
|
||||||
**Planes Empresariales:**
|
**Planes Empresa:**
|
||||||
- Precio mensual fijo, sin excedentes
|
- Precio mensual fijo, sin excedentes
|
||||||
- Límites de uso personalizados según el acuerdo
|
- Límites de uso personalizados según el acuerdo
|
||||||
|
|
||||||
@@ -218,23 +222,23 @@ Sim utiliza un modelo de facturación de **suscripción base + excedente**:
|
|||||||
Cuando el excedente no facturado alcanza los $50, Sim factura automáticamente el monto total no facturado.
|
Cuando el excedente no facturado alcanza los $50, Sim factura automáticamente el monto total no facturado.
|
||||||
|
|
||||||
**Ejemplo:**
|
**Ejemplo:**
|
||||||
- Día 10: $70 de excedente → Factura inmediata de $70
|
- Día 10: $70 de excedente → Factura $70 inmediatamente
|
||||||
- Día 15: $35 adicionales de uso ($105 en total) → Ya facturado, sin acción
|
- Día 15: $35 adicionales de uso ($105 total) → Ya facturado, sin acción
|
||||||
- Día 20: Otros $50 de uso ($155 en total, $85 no facturados) → Factura inmediata de $85
|
- Día 20: Otros $50 de uso ($155 total, $85 sin facturar) → Factura $85 inmediatamente
|
||||||
|
|
||||||
Esto distribuye los cargos por exceso a lo largo del mes en lugar de una gran factura al final del período.
|
Esto distribuye los cargos por excedentes grandes a lo largo del mes en lugar de una sola factura grande al final del período.
|
||||||
|
|
||||||
## Mejores prácticas para la gestión de costos
|
## Mejores prácticas de gestión de costos
|
||||||
|
|
||||||
1. **Monitorear regularmente**: Revisa tu panel de uso con frecuencia para evitar sorpresas
|
1. **Monitorea regularmente**: Revisa tu panel de uso con frecuencia para evitar sorpresas
|
||||||
2. **Establecer presupuestos**: Utiliza los límites del plan como guías para tu gasto
|
2. **Establece presupuestos**: Usa los límites del plan como barreras de protección para tu gasto
|
||||||
3. **Optimizar flujos de trabajo**: Revisa las ejecuciones de alto costo y optimiza los prompts o la selección de modelos
|
3. **Optimiza flujos de trabajo**: Revisa las ejecuciones de alto costo y optimiza los prompts o la selección de modelos
|
||||||
4. **Usar modelos apropiados**: Ajusta la complejidad del modelo a los requisitos de la tarea
|
4. **Usa modelos apropiados**: Ajusta la complejidad del modelo a los requisitos de la tarea
|
||||||
5. **Agrupar tareas similares**: Combina múltiples solicitudes cuando sea posible para reducir la sobrecarga
|
5. **Agrupa tareas similares**: Combina múltiples solicitudes cuando sea posible para reducir la sobrecarga
|
||||||
|
|
||||||
## Próximos pasos
|
## Próximos pasos
|
||||||
|
|
||||||
- Revisa tu uso actual en [Configuración → Suscripción](https://sim.ai/settings/subscription)
|
- Revisa tu uso actual en [Configuración → Suscripción](https://sim.ai/settings/subscription)
|
||||||
- Aprende sobre [Registro](/execution/logging) para seguir los detalles de ejecución
|
- Aprende sobre [Registro](/execution/logging) para rastrear detalles de ejecución
|
||||||
- Explora la [API externa](/execution/api) para el monitoreo programático de costos
|
- Explora la [API externa](/execution/api) para monitoreo programático de costos
|
||||||
- Consulta las [técnicas de optimización de flujo de trabajo](/blocks) para reducir costos
|
- Consulta las [técnicas de optimización de flujos de trabajo](/blocks) para reducir costos
|
||||||
@@ -105,26 +105,30 @@ La répartition des modèles montre :
|
|||||||
Les prix indiqués reflètent les tarifs en date du 10 septembre 2025. Consultez la documentation des fournisseurs pour les tarifs actuels.
|
Les prix indiqués reflètent les tarifs en date du 10 septembre 2025. Consultez la documentation des fournisseurs pour les tarifs actuels.
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
|
## Apportez votre propre clé (BYOK)
|
||||||
|
|
||||||
|
Vous pouvez utiliser vos propres clés API pour les modèles hébergés (OpenAI, Anthropic, Google, Mistral) dans **Paramètres → BYOK** pour payer les prix de base. Les clés sont chiffrées et s'appliquent à l'ensemble de l'espace de travail.
|
||||||
|
|
||||||
## Stratégies d'optimisation des coûts
|
## Stratégies d'optimisation des coûts
|
||||||
|
|
||||||
- **Sélection du modèle** : choisissez les modèles en fonction de la complexité de la tâche. Les tâches simples peuvent utiliser GPT-4.1-nano tandis que le raisonnement complexe pourrait nécessiter o1 ou Claude Opus.
|
- **Sélection du modèle** : choisissez les modèles en fonction de la complexité de la tâche. Les tâches simples peuvent utiliser GPT-4.1-nano tandis que le raisonnement complexe peut nécessiter o1 ou Claude Opus.
|
||||||
- **Ingénierie de prompt** : des prompts bien structurés et concis réduisent l'utilisation de tokens sans sacrifier la qualité.
|
- **Ingénierie des prompts** : des prompts bien structurés et concis réduisent l'utilisation de jetons sans sacrifier la qualité.
|
||||||
- **Modèles locaux** : utilisez Ollama ou VLLM pour les tâches non critiques afin d'éliminer complètement les coûts d'API.
|
- **Modèles locaux** : utilisez Ollama ou VLLM pour les tâches non critiques afin d'éliminer complètement les coûts d'API.
|
||||||
- **Mise en cache et réutilisation** : stockez les résultats fréquemment utilisés dans des variables ou des fichiers pour éviter des appels répétés aux modèles d'IA.
|
- **Mise en cache et réutilisation** : stockez les résultats fréquemment utilisés dans des variables ou des fichiers pour éviter les appels répétés aux modèles d'IA.
|
||||||
- **Traitement par lots** : traitez plusieurs éléments dans une seule requête d'IA plutôt que de faire des appels individuels.
|
- **Traitement par lots** : traitez plusieurs éléments dans une seule requête d'IA plutôt que d'effectuer des appels individuels.
|
||||||
|
|
||||||
## Suivi de l'utilisation
|
## Surveillance de l'utilisation
|
||||||
|
|
||||||
Surveillez votre utilisation et votre facturation dans Paramètres → Abonnement :
|
Surveillez votre utilisation et votre facturation dans Paramètres → Abonnement :
|
||||||
|
|
||||||
- **Utilisation actuelle** : utilisation et coûts en temps réel pour la période en cours
|
- **Utilisation actuelle** : utilisation et coûts en temps réel pour la période en cours
|
||||||
- **Limites d'utilisation** : limites du forfait avec indicateurs visuels de progression
|
- **Limites d'utilisation** : limites du forfait avec indicateurs de progression visuels
|
||||||
- **Détails de facturation** : frais prévisionnels et engagements minimums
|
- **Détails de facturation** : frais projetés et engagements minimums
|
||||||
- **Gestion du forfait** : options de mise à niveau et historique de facturation
|
- **Gestion du forfait** : options de mise à niveau et historique de facturation
|
||||||
|
|
||||||
### Suivi d'utilisation programmatique
|
### Suivi programmatique de l'utilisation
|
||||||
|
|
||||||
Vous pouvez interroger votre utilisation actuelle et vos limites par programmation en utilisant l'API :
|
Vous pouvez interroger votre utilisation et vos limites actuelles de manière programmatique à l'aide de l'API :
|
||||||
|
|
||||||
**Point de terminaison :**
|
**Point de terminaison :**
|
||||||
|
|
||||||
@@ -172,14 +176,14 @@ curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" htt
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Champs de limite de débit :**
|
**Champs de limite de débit :**
|
||||||
- `requestsPerMinute` : limite de débit soutenu (les jetons se rechargent à ce rythme)
|
- `requestsPerMinute` : limite de débit soutenue (les jetons se rechargent à ce rythme)
|
||||||
- `maxBurst` : nombre maximum de jetons que vous pouvez accumuler (capacité de rafale)
|
- `maxBurst` : nombre maximum de jetons que vous pouvez accumuler (capacité de rafale)
|
||||||
- `remaining` : jetons actuellement disponibles (peut aller jusqu'à `maxBurst`)
|
- `remaining` : jetons actuellement disponibles (peut aller jusqu'à `maxBurst`)
|
||||||
|
|
||||||
**Champs de réponse :**
|
**Champs de réponse :**
|
||||||
- `currentPeriodCost` reflète l'utilisation dans la période de facturation actuelle
|
- `currentPeriodCost` reflète l'utilisation dans la période de facturation actuelle
|
||||||
- `limit` est dérivé des limites individuelles (Gratuit/Pro) ou des limites mutualisées de l'organisation (Équipe/Entreprise)
|
- `limit` est dérivé des limites individuelles (Free/Pro) ou des limites d'organisation mutualisées (Team/Enterprise)
|
||||||
- `plan` est le plan actif de plus haute priorité associé à votre utilisateur
|
- `plan` est le forfait actif de priorité la plus élevée associé à votre utilisateur
|
||||||
|
|
||||||
## Limites des forfaits
|
## Limites des forfaits
|
||||||
|
|
||||||
@@ -196,21 +200,21 @@ Les différents forfaits d'abonnement ont des limites d'utilisation différentes
|
|||||||
|
|
||||||
Sim utilise un modèle de facturation **abonnement de base + dépassement** :
|
Sim utilise un modèle de facturation **abonnement de base + dépassement** :
|
||||||
|
|
||||||
### Comment ça fonctionne
|
### Fonctionnement
|
||||||
|
|
||||||
**Forfait Pro (20 $/mois) :**
|
**Forfait Pro (20 $/mois) :**
|
||||||
- L'abonnement mensuel inclut 20 $ d'utilisation
|
- L'abonnement mensuel inclut 20 $ d'utilisation
|
||||||
- Utilisation inférieure à 20 $ → Pas de frais supplémentaires
|
- Utilisation inférieure à 20 $ → Aucun frais supplémentaire
|
||||||
- Utilisation supérieure à 20 $ → Paiement du dépassement en fin de mois
|
- Utilisation supérieure à 20 $ → Paiement du dépassement en fin de mois
|
||||||
- Exemple : 35 $ d'utilisation = 20 $ (abonnement) + 15 $ (dépassement)
|
- Exemple : 35 $ d'utilisation = 20 $ (abonnement) + 15 $ (dépassement)
|
||||||
|
|
||||||
**Forfait Équipe (40 $/siège/mois) :**
|
**Forfait Équipe (40 $/utilisateur/mois) :**
|
||||||
- Utilisation mutualisée pour tous les membres de l'équipe
|
- Utilisation mutualisée entre tous les membres de l'équipe
|
||||||
- Dépassement calculé à partir de l'utilisation totale de l'équipe
|
- Dépassement calculé sur l'utilisation totale de l'équipe
|
||||||
- Le propriétaire de l'organisation reçoit une seule facture
|
- Le propriétaire de l'organisation reçoit une seule facture
|
||||||
|
|
||||||
**Forfaits Entreprise :**
|
**Forfaits Entreprise :**
|
||||||
- Prix mensuel fixe, pas de dépassements
|
- Prix mensuel fixe, sans dépassement
|
||||||
- Limites d'utilisation personnalisées selon l'accord
|
- Limites d'utilisation personnalisées selon l'accord
|
||||||
|
|
||||||
### Facturation par seuil
|
### Facturation par seuil
|
||||||
@@ -220,21 +224,21 @@ Lorsque le dépassement non facturé atteint 50 $, Sim facture automatiquement l
|
|||||||
**Exemple :**
|
**Exemple :**
|
||||||
- Jour 10 : 70 $ de dépassement → Facturation immédiate de 70 $
|
- Jour 10 : 70 $ de dépassement → Facturation immédiate de 70 $
|
||||||
- Jour 15 : 35 $ d'utilisation supplémentaire (105 $ au total) → Déjà facturé, aucune action
|
- Jour 15 : 35 $ d'utilisation supplémentaire (105 $ au total) → Déjà facturé, aucune action
|
||||||
- Jour 20 : 50 $ d'utilisation supplémentaire (155 $ au total, 85 $ non facturés) → Facturation immédiate de 85 $
|
- Jour 20 : 50 $ d'utilisation supplémentaire (155 $ au total, 85 $ non facturé) → Facturation immédiate de 85 $
|
||||||
|
|
||||||
Cela répartit les frais de dépassement importants tout au long du mois au lieu d'une seule facture importante en fin de période.
|
Cela répartit les frais de dépassement importants tout au long du mois au lieu d'une seule facture importante en fin de période.
|
||||||
|
|
||||||
## Meilleures pratiques de gestion des coûts
|
## Bonnes pratiques de gestion des coûts
|
||||||
|
|
||||||
1. **Surveillez régulièrement** : vérifiez fréquemment votre tableau de bord d'utilisation pour éviter les surprises
|
1. **Surveillez régulièrement** : Consultez fréquemment votre tableau de bord d'utilisation pour éviter les surprises
|
||||||
2. **Définissez des budgets** : utilisez les limites du plan comme garde-fous pour vos dépenses
|
2. **Définissez des budgets** : Utilisez les limites des forfaits comme garde-fous pour vos dépenses
|
||||||
3. **Optimisez les flux de travail** : examinez les exécutions à coût élevé et optimisez les prompts ou la sélection de modèles
|
3. **Optimisez les flux de travail** : Examinez les exécutions coûteuses et optimisez les prompts ou la sélection de modèles
|
||||||
4. **Utilisez des modèles appropriés** : adaptez la complexité du modèle aux exigences de la tâche
|
4. **Utilisez les modèles appropriés** : Adaptez la complexité du modèle aux exigences de la tâche
|
||||||
5. **Regroupez les tâches similaires** : combinez plusieurs requêtes lorsque c'est possible pour réduire les frais généraux
|
5. **Regroupez les tâches similaires** : Combinez plusieurs requêtes lorsque c'est possible pour réduire les frais généraux
|
||||||
|
|
||||||
## Prochaines étapes
|
## Prochaines étapes
|
||||||
|
|
||||||
- Examinez votre utilisation actuelle dans [Paramètres → Abonnement](https://sim.ai/settings/subscription)
|
- Consultez votre utilisation actuelle dans [Paramètres → Abonnement](https://sim.ai/settings/subscription)
|
||||||
- Apprenez-en plus sur la [Journalisation](/execution/logging) pour suivre les détails d'exécution
|
- Découvrez la [journalisation](/execution/logging) pour suivre les détails d'exécution
|
||||||
- Explorez l'[API externe](/execution/api) pour la surveillance programmatique des coûts
|
- Explorez l'[API externe](/execution/api) pour la surveillance programmatique des coûts
|
||||||
- Consultez les [techniques d'optimisation de flux de travail](/blocks) pour réduire les coûts
|
- Consultez les [techniques d'optimisation des workflows](/blocks) pour réduire les coûts
|
||||||
@@ -105,43 +105,47 @@ AIブロックを使用するワークフローでは、ログで詳細なコス
|
|||||||
表示価格は2025年9月10日時点のレートを反映しています。最新の価格については各プロバイダーのドキュメントをご確認ください。
|
表示価格は2025年9月10日時点のレートを反映しています。最新の価格については各プロバイダーのドキュメントをご確認ください。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
|
## Bring Your Own Key (BYOK)
|
||||||
|
|
||||||
|
ホストされたモデル(OpenAI、Anthropic、Google、Mistral)に対して、**設定 → BYOK**で独自のAPIキーを使用し、基本価格で支払うことができます。キーは暗号化され、ワークスペース全体に適用されます。
|
||||||
|
|
||||||
## コスト最適化戦略
|
## コスト最適化戦略
|
||||||
|
|
||||||
- **モデル選択**: タスクの複雑さに基づいてモデルを選択してください。単純なタスクにはGPT-4.1-nanoを使用し、複雑な推論にはo1やClaude Opusが必要な場合があります。
|
- **モデルの選択**: タスクの複雑さに基づいてモデルを選択します。シンプルなタスクにはGPT-4.1-nanoを使用し、複雑な推論にはo1やClaude Opusが必要になる場合があります。
|
||||||
- **プロンプトエンジニアリング**: 構造化された簡潔なプロンプトは、品質を犠牲にすることなくトークン使用量を削減します。
|
- **プロンプトエンジニアリング**: 適切に構造化された簡潔なプロンプトは、品質を犠牲にすることなくトークン使用量を削減します。
|
||||||
- **ローカルモデル**: 重要度の低いタスクにはOllamaやVLLMを使用して、API費用を完全に排除します。
|
- **ローカルモデル**: 重要度の低いタスクにはOllamaやVLLMを使用して、APIコストを完全に排除します。
|
||||||
- **キャッシュと再利用**: 頻繁に使用される結果を変数やファイルに保存して、AIモデル呼び出しの繰り返しを避けます。
|
- **キャッシュと再利用**: 頻繁に使用される結果を変数やファイルに保存して、AIモデルの繰り返し呼び出しを回避します。
|
||||||
- **バッチ処理**: 個別の呼び出しを行うのではなく、単一のAIリクエストで複数のアイテムを処理します。
|
- **バッチ処理**: 個別の呼び出しを行うのではなく、単一のAIリクエストで複数のアイテムを処理します。
|
||||||
|
|
||||||
## 使用状況モニタリング
|
## 使用状況の監視
|
||||||
|
|
||||||
設定 → サブスクリプションで使用状況と請求を監視できます:
|
設定 → サブスクリプションで使用状況と請求を監視します:
|
||||||
|
|
||||||
- **現在の使用状況**: 現在の期間のリアルタイムの使用状況とコスト
|
- **現在の使用状況**: 現在の期間のリアルタイムの使用状況とコスト
|
||||||
- **使用制限**: 視覚的な進捗指標付きのプラン制限
|
- **使用制限**: 視覚的な進行状況インジケーター付きのプラン制限
|
||||||
- **請求詳細**: 予測される料金と最低利用額
|
- **請求詳細**: 予測される料金と最低コミットメント
|
||||||
- **プラン管理**: アップグレードオプションと請求履歴
|
- **プラン管理**: アップグレードオプションと請求履歴
|
||||||
|
|
||||||
### プログラムによる使用状況の追跡
|
### プログラムによる使用状況の追跡
|
||||||
|
|
||||||
APIを使用して、現在の使用状況と制限をプログラムで照会できます:
|
APIを使用して、現在の使用状況と制限をプログラムでクエリできます:
|
||||||
|
|
||||||
**エンドポイント:**
|
**エンドポイント:**
|
||||||
|
|
||||||
```text
|
```text
|
||||||
GET /api/users/me/usage-limits
|
GET /api/users/me/usage-limits
|
||||||
```
|
```
|
||||||
|
|
||||||
**認証:**
|
**認証:**
|
||||||
- APIキーを `X-API-Key` ヘッダーに含めてください
|
- `X-API-Key`ヘッダーにAPIキーを含めます
|
||||||
|
|
||||||
**リクエスト例:**
|
**リクエスト例:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
|
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
|
||||||
```
|
```
|
||||||
|
|
||||||
**レスポンス例:**
|
**レスポンス例:**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -171,70 +175,70 @@ curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" htt
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**レート制限フィールド:**
|
**レート制限フィールド:**
|
||||||
- `requestsPerMinute`:持続的なレート制限(トークンはこの速度で補充されます)
|
- `requestsPerMinute`: 持続的なレート制限(トークンはこのレートで補充されます)
|
||||||
- `maxBurst`:蓄積できる最大トークン数(バースト容量)
|
- `maxBurst`: 蓄積できる最大トークン数(バースト容量)
|
||||||
- `remaining`:現在利用可能なトークン(最大で`maxBurst`まで)
|
- `remaining`: 現在利用可能なトークン数(最大`maxBurst`まで)
|
||||||
|
|
||||||
**レスポンスフィールド:**
|
**レスポンスフィールド:**
|
||||||
- `currentPeriodCost`は現在の請求期間の使用状況を反映します
|
- `currentPeriodCost`は現在の請求期間の使用状況を反映します
|
||||||
- `limit`は個別の制限(無料/プロ)または組織のプール制限(チーム/エンタープライズ)から派生します
|
- `limit`は個別の制限(Free/Pro)またはプールされた組織の制限(Team/Enterprise)から導出されます
|
||||||
- `plan`はユーザーに関連付けられた最優先のアクティブなプランです
|
- `plan`はユーザーに関連付けられた最も優先度の高いアクティブなプランです
|
||||||
|
|
||||||
## プラン制限
|
## プランの制限
|
||||||
|
|
||||||
サブスクリプションプランによって使用制限が異なります:
|
サブスクリプションプランによって、使用量の制限が異なります。
|
||||||
|
|
||||||
| プラン | 月間使用制限 | レート制限(毎分) |
|
| プラン | 月間使用量制限 | レート制限(1分あたり) |
|
||||||
|------|-------------------|-------------------------|
|
|------|-------------------|-------------------------|
|
||||||
| **Free** | $20 | 同期5、非同期10 |
|
| **無料** | $20 | 同期5、非同期10 |
|
||||||
| **Pro** | $100 | 同期10、非同期50 |
|
| **プロ** | $100 | 同期10、非同期50 |
|
||||||
| **Team** | $500(プール) | 同期50、非同期100 |
|
| **チーム** | $500(プール) | 同期50、非同期100 |
|
||||||
| **Enterprise** | カスタム | カスタム |
|
| **エンタープライズ** | カスタム | カスタム |
|
||||||
|
|
||||||
## 課金モデル
|
## 課金モデル
|
||||||
|
|
||||||
Simは**基本サブスクリプション+超過分**の課金モデルを使用しています:
|
Simは**基本サブスクリプション + 超過料金**の課金モデルを採用しています。
|
||||||
|
|
||||||
### 仕組み
|
### 仕組み
|
||||||
|
|
||||||
**プロプラン(月額$20):**
|
**プロプラン(月額$20):**
|
||||||
- 月額サブスクリプションには$20分の使用量が含まれます
|
- 月額サブスクリプションには$20分の使用量が含まれます
|
||||||
- 使用量が$20未満 → 追加料金なし
|
- 使用量が$20未満 → 追加料金なし
|
||||||
- 使用量が$20を超える → 月末に超過分を支払い
|
- 使用量が$20超過 → 月末に超過分を支払い
|
||||||
- 例:$35の使用量 = $20(サブスクリプション)+ $15(超過分)
|
- 例:使用量$35 = $20(サブスクリプション)+ $15(超過料金)
|
||||||
|
|
||||||
**チームプラン(席あたり月額$40):**
|
**チームプラン(1席あたり月額$40):**
|
||||||
- チームメンバー全体でプールされた使用量
|
- チームメンバー全員で使用量をプール
|
||||||
- チーム全体の使用量から超過分を計算
|
- チーム全体の使用量から超過料金を計算
|
||||||
- 組織のオーナーが一括で請求を受ける
|
- 組織のオーナーが1つの請求書を受け取ります
|
||||||
|
|
||||||
**エンタープライズプラン:**
|
**エンタープライズプラン:**
|
||||||
- 固定月額料金、超過料金なし
|
- 固定月額料金、超過料金なし
|
||||||
- 契約に基づくカスタム使用制限
|
- 契約に基づくカスタム使用量制限
|
||||||
|
|
||||||
### しきい値課金
|
### しきい値課金
|
||||||
|
|
||||||
未請求の超過分が$50に達すると、Simは自動的に未請求の全額を請求します。
|
未請求の超過料金が$50に達すると、Simは未請求金額の全額を自動的に請求します。
|
||||||
|
|
||||||
**例:**
|
**例:**
|
||||||
- 10日目:$70の超過分 → 即時に$70を請求
|
- 10日目:超過料金$70 → 即座に$70を請求
|
||||||
- 15日目:追加$35の使用(合計$105) → すでに請求済み、アクションなし
|
- 15日目:追加使用量$35(合計$105) → すでに請求済み、アクションなし
|
||||||
- 20日目:さらに$50の使用(合計$155、未請求$85) → 即時に$85を請求
|
- 20日目:さらに$50の使用量(合計$155、未請求$85) → 即座に$85を請求
|
||||||
|
|
||||||
これにより、期間終了時に一度に大きな請求が発生するのではなく、月全体に大きな超過料金が分散されます。
|
これにより、期間終了時の1回の大きな請求ではなく、大きな超過料金を月全体に分散させることができます。
|
||||||
|
|
||||||
## コスト管理のベストプラクティス
|
## コスト管理のベストプラクティス
|
||||||
|
|
||||||
1. **定期的な監視**: 予期せぬ事態を避けるため、使用状況ダッシュボードを頻繁に確認する
|
1. **定期的な監視**:予期しない事態を避けるため、使用状況ダッシュボードを頻繁に確認してください
|
||||||
2. **予算の設定**: プランの制限を支出のガードレールとして使用する
|
2. **予算の設定**:プランの制限を支出のガードレールとして使用してください
|
||||||
3. **ワークフローの最適化**: コストの高い実行を見直し、プロンプトやモデル選択を最適化する
|
3. **ワークフローの最適化**:コストの高い実行を確認し、プロンプトやモデルの選択を最適化してください
|
||||||
4. **適切なモデルの使用**: タスクの要件にモデルの複雑さを合わせる
|
4. **適切なモデルの使用**:タスクの要件に合わせてモデルの複雑さを選択してください
|
||||||
5. **類似タスクのバッチ処理**: 可能な場合は複数のリクエストを組み合わせてオーバーヘッドを削減する
|
5. **類似タスクのバッチ処理**:可能な限り複数のリクエストを組み合わせて、オーバーヘッドを削減してください
|
||||||
|
|
||||||
## 次のステップ
|
## 次のステップ
|
||||||
|
|
||||||
- [設定 → サブスクリプション](https://sim.ai/settings/subscription)で現在の使用状況を確認する
|
- [設定 → サブスクリプション](https://sim.ai/settings/subscription)で現在の使用状況を確認する
|
||||||
- 実行詳細を追跡するための[ロギング](/execution/logging)について学ぶ
|
- 実行の詳細を追跡するための[ログ記録](/execution/logging)について学ぶ
|
||||||
- プログラムによるコスト監視のための[外部API](/execution/api)を探索する
|
- プログラムによるコスト監視のための[外部API](/execution/api)を探索する
|
||||||
- コスト削減のための[ワークフロー最適化テクニック](/blocks)をチェックする
|
- コストを削減するための[ワークフロー最適化テクニック](/blocks)を確認する
|
||||||
@@ -105,43 +105,47 @@ totalCost = baseExecutionCharge + modelCost
|
|||||||
显示的价格为截至 2025 年 9 月 10 日的费率。请查看提供商文档以获取最新价格。
|
显示的价格为截至 2025 年 9 月 10 日的费率。请查看提供商文档以获取最新价格。
|
||||||
</Callout>
|
</Callout>
|
||||||
|
|
||||||
|
## 自带密钥(BYOK)
|
||||||
|
|
||||||
|
你可以在 **设置 → BYOK** 中为托管模型(OpenAI、Anthropic、Google、Mistral)使用你自己的 API 密钥,以按基础价格计费。密钥会被加密,并在整个工作区范围内生效。
|
||||||
|
|
||||||
## 成本优化策略
|
## 成本优化策略
|
||||||
|
|
||||||
- **模型选择**:根据任务复杂性选择模型。简单任务可以使用 GPT-4.1-nano,而复杂推理可能需要 o1 或 Claude Opus。
|
- **模型选择**:根据任务复杂度选择合适的模型。简单任务可用 GPT-4.1-nano,复杂推理可选 o1 或 Claude Opus。
|
||||||
- **提示工程**:结构良好、简洁的提示可以减少令牌使用,同时保持质量。
|
- **提示工程**:结构清晰、简洁的提示能减少 token 使用量,同时保证质量。
|
||||||
- **本地模型**:对于非关键任务,使用 Ollama 或 VLLM 完全消除 API 成本。
|
- **本地模型**:对于非关键任务,使用 Ollama 或 VLLM,可完全消除 API 成本。
|
||||||
- **缓存和重用**:将经常使用的结果存储在变量或文件中,以避免重复调用 AI 模型。
|
- **缓存与复用**:将常用结果存储在变量或文件中,避免重复调用 AI 模型。
|
||||||
- **批量处理**:在单次 AI 请求中处理多个项目,而不是逐一调用。
|
- **批量处理**:一次 AI 请求处理多个项目,减少单独调用次数。
|
||||||
|
|
||||||
## 使用监控
|
## 使用监控
|
||||||
|
|
||||||
在 设置 → 订阅 中监控您的使用情况和账单:
|
你可以在 设置 → 订阅 中监控你的用量和账单:
|
||||||
|
|
||||||
- **当前使用情况**:当前周期的实时使用和成本
|
- **当前用量**:当前周期的实时用量和费用
|
||||||
- **使用限制**:计划限制及其可视化进度指示器
|
- **用量上限**:带有可视化进度指示的套餐限制
|
||||||
- **账单详情**:预计费用和最低承诺
|
- **账单明细**:预计费用和最低承诺金额
|
||||||
- **计划管理**:升级选项和账单历史记录
|
- **套餐管理**:升级选项和账单历史
|
||||||
|
|
||||||
### 程序化使用跟踪
|
### 编程方式用量追踪
|
||||||
|
|
||||||
您可以通过 API 程序化地查询当前的使用情况和限制:
|
你可以通过 API 以编程方式查询当前用量和限制:
|
||||||
|
|
||||||
**端点:**
|
**接口地址:**
|
||||||
|
|
||||||
```text
|
```text
|
||||||
GET /api/users/me/usage-limits
|
GET /api/users/me/usage-limits
|
||||||
```
|
```
|
||||||
|
|
||||||
**认证:**
|
**认证方式:**
|
||||||
- 在 `X-API-Key` 标头中包含您的 API 密钥
|
- 在 `X-API-Key` header 中包含你的 API 密钥
|
||||||
|
|
||||||
**示例请求:**
|
**请求示例:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
|
curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" https://sim.ai/api/users/me/usage-limits
|
||||||
```
|
```
|
||||||
|
|
||||||
**示例响应:**
|
**响应示例:**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -171,70 +175,70 @@ curl -X GET -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" htt
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**速率限制字段:**
|
**限流字段:**
|
||||||
- `requestsPerMinute`:持续速率限制(令牌以此速率补充)
|
- `requestsPerMinute`:持续速率限制(token 按此速率补充)
|
||||||
- `maxBurst`:您可以累积的最大令牌数(突发容量)
|
- `maxBurst`:你可累计的最大 token 数(突发容量)
|
||||||
- `remaining`:当前可用令牌数(最多可达 `maxBurst`)
|
- `remaining`:当前可用 token 数(最多可达 `maxBurst`)
|
||||||
|
|
||||||
**响应字段:**
|
**响应字段:**
|
||||||
- `currentPeriodCost` 反映当前计费周期的使用情况
|
- `currentPeriodCost` 反映当前账单周期的用量
|
||||||
- `limit` 来源于个人限制(免费/专业)或组织池限制(团队/企业)
|
- `limit` 来源于个人限额(Free/Pro)或组织池化限额(Team/Enterprise)
|
||||||
- `plan` 是与您的用户关联的最高优先级的活动计划
|
- `plan` 是与你的用户关联的最高优先级的激活套餐
|
||||||
|
|
||||||
## 计划限制
|
## 套餐限制
|
||||||
|
|
||||||
不同的订阅计划有不同的使用限制:
|
不同的订阅套餐有不同的使用限制:
|
||||||
|
|
||||||
| 方案 | 每月使用限额 | 速率限制(每分钟) |
|
| 套餐 | 每月使用额度 | 速率限制(每分钟) |
|
||||||
|------|-------------------|-------------------------|
|
|------|-------------------|-------------------------|
|
||||||
| **Free** | $20 | 5 sync,10 async |
|
| **Free** | $20 | 5 sync,10 async |
|
||||||
| **Pro** | $100 | 10 sync,50 async |
|
| **Pro** | $100 | 10 sync,50 async |
|
||||||
| **Team** | $500(共享) | 50 sync,100 async |
|
| **Team** | $500(共享) | 50 sync,100 async |
|
||||||
| **Enterprise** | 定制 | 定制 |
|
| **Enterprise** | 自定义 | 自定义 |
|
||||||
|
|
||||||
## 计费模式
|
## 计费模式
|
||||||
|
|
||||||
Sim 使用 **基础订阅 + 超额** 的计费模式:
|
Sim 采用**基础订阅 + 超额**计费模式:
|
||||||
|
|
||||||
### 工作原理
|
### 计费方式说明
|
||||||
|
|
||||||
**专业计划($20/月):**
|
**Pro 套餐($20/月):**
|
||||||
- 每月订阅包含 $20 的使用额度
|
- 月度订阅包含 $20 使用额度
|
||||||
- 使用低于 $20 → 无额外费用
|
- 使用未超过 $20 → 无额外费用
|
||||||
- 使用超过 $20 → 月底支付超额部分
|
- 使用超过 $20 → 月底结算超额部分
|
||||||
- 示例:$35 使用 = $20(订阅)+ $15(超额)
|
- 示例:$35 使用 = $20(订阅)+ $15(超额)
|
||||||
|
|
||||||
**团队计划($40/每席位/月):**
|
**Team 套餐($40/人/月):**
|
||||||
- 团队成员之间共享使用额度
|
- 团队成员共享使用额度
|
||||||
- 超额费用根据团队总使用量计算
|
- 超额费用按团队总用量计算
|
||||||
- 组织所有者收到一张账单
|
- 账单由组织所有者统一支付
|
||||||
|
|
||||||
**企业计划:**
|
**Enterprise 套餐:**
|
||||||
- 固定月费,无超额费用
|
- 固定月费,无超额费用
|
||||||
- 根据协议自定义使用限制
|
- 使用额度可按协议定制
|
||||||
|
|
||||||
### 阈值计费
|
### 阈值计费
|
||||||
|
|
||||||
当未计费的超额费用达到 $50 时,Sim 会自动计费全额未计费金额。
|
当未结算的超额费用达到 $50 时,Sim 会自动结算全部未结算金额。
|
||||||
|
|
||||||
**示例:**
|
**示例:**
|
||||||
- 第 10 天:$70 超额 → 立即计费 $70
|
- 第 10 天:超额 $70 → 立即结算 $70
|
||||||
- 第 15 天:额外使用 $35(总计 $105)→ 已计费,无需操作
|
- 第 15 天:新增 $35 使用(累计 $105)→ 已结算,无需操作
|
||||||
- 第 20 天:再使用 $50(总计 $155,未计费 $85)→ 立即计费 $85
|
- 第 20 天:再用 $50(累计 $155,未结算 $85)→ 立即结算 $85
|
||||||
|
|
||||||
这会将大量的超额费用分散到整个月,而不是在周期结束时收到一张大账单。
|
这样可以将大额超额费用分摊到每月多次结算,避免期末一次性大额账单。
|
||||||
|
|
||||||
## 成本管理最佳实践
|
## 成本管理最佳实践
|
||||||
|
|
||||||
1. **定期监控**:经常检查您的使用仪表板,避免意外情况
|
1. **定期监控**:经常查看用量仪表盘,避免意外支出
|
||||||
2. **设定预算**:使用计划限制作为支出控制的护栏
|
2. **设置预算**:用套餐额度作为支出警戒线
|
||||||
3. **优化工作流程**:审查高成本的执行操作,优化提示或模型选择
|
3. **优化流程**:检查高成本执行,优化提示词或模型选择
|
||||||
4. **使用合适的模型**:根据任务需求匹配模型复杂度
|
4. **选择合适模型**:根据任务需求匹配模型复杂度
|
||||||
5. **批量处理相似任务**:尽可能合并多个请求以减少开销
|
5. **批量处理相似任务**:尽量合并请求,减少额外开销
|
||||||
|
|
||||||
## 下一步
|
## 下一步
|
||||||
|
|
||||||
- 在 [设置 → 订阅](https://sim.ai/settings/subscription) 中查看您当前的使用情况
|
- 在 [设置 → 订阅](https://sim.ai/settings/subscription) 中查看您当前的使用情况
|
||||||
- 了解[日志记录](/execution/logging)以跟踪执行详情
|
- 了解 [日志记录](/execution/logging),以跟踪执行详情
|
||||||
- 探索[外部 API](/execution/api)以进行程序化成本监控
|
- 探索 [外部 API](/execution/api),实现程序化成本监控
|
||||||
- 查看[工作流优化技术](/blocks)以降低成本
|
- 查看 [工作流优化技巧](/blocks),以降低成本
|
||||||
@@ -4581,39 +4581,41 @@ checksums:
|
|||||||
content/19: 83fc31418ff454a5e06b290e3708ef32
|
content/19: 83fc31418ff454a5e06b290e3708ef32
|
||||||
content/20: 4392b5939a6d5774fb080cad1ee1dbb8
|
content/20: 4392b5939a6d5774fb080cad1ee1dbb8
|
||||||
content/21: 890b65b7326a9eeef3933a8b63f6ccdd
|
content/21: 890b65b7326a9eeef3933a8b63f6ccdd
|
||||||
content/22: 892d6a80d8ac5a895a20408462f63cc5
|
content/22: ada515cf6e2e0f9d3f57f720f79699d3
|
||||||
content/23: 930176b3786ebbe9eb1f76488f183140
|
content/23: 332e0d08f601da9fb56c6b7e7c8e9daf
|
||||||
content/24: 22d9d167630c581e868d6d7a9fdddbcf
|
content/24: 892d6a80d8ac5a895a20408462f63cc5
|
||||||
content/25: d250621762d63cd87b3359236c95bdac
|
content/25: 930176b3786ebbe9eb1f76488f183140
|
||||||
content/26: 50be8ae73b8ce27de7ddd21964ee29e8
|
content/26: 22d9d167630c581e868d6d7a9fdddbcf
|
||||||
content/27: cd622841b5bc748a7b2a0d9252e72bd5
|
content/27: d250621762d63cd87b3359236c95bdac
|
||||||
content/28: 38608a5d416eb33f373c6f9e6bf546b9
|
content/28: 50be8ae73b8ce27de7ddd21964ee29e8
|
||||||
content/29: 074c12c794283c3af53a3f038fbda2a6
|
content/29: cd622841b5bc748a7b2a0d9252e72bd5
|
||||||
content/30: 5cdcf7e32294e087612b77914d850d26
|
content/30: 38608a5d416eb33f373c6f9e6bf546b9
|
||||||
content/31: 7529829b2f064fedf956da639aaea8e1
|
content/31: 074c12c794283c3af53a3f038fbda2a6
|
||||||
content/32: 7b5e2207a0d93fd434b92f2f290a8dd5
|
content/32: 5cdcf7e32294e087612b77914d850d26
|
||||||
content/33: f950b8f58af1973a3e00393d860bce02
|
content/33: 7529829b2f064fedf956da639aaea8e1
|
||||||
content/34: d5ff07fec9455183e1d93f7ddf1dab1b
|
content/34: 7b5e2207a0d93fd434b92f2f290a8dd5
|
||||||
content/35: 5d2d85e082d9fdd3859fb5c788d5f9a3
|
content/35: f950b8f58af1973a3e00393d860bce02
|
||||||
content/36: 23a7de9c5adb6e07c28c23a9d4e03dc2
|
content/36: d5ff07fec9455183e1d93f7ddf1dab1b
|
||||||
content/37: 7bb928aba33a4013ad5f08487da5bbf9
|
content/37: 5d2d85e082d9fdd3859fb5c788d5f9a3
|
||||||
content/38: dbbf313837f13ddfa4a8843d71cb9cc4
|
content/38: 23a7de9c5adb6e07c28c23a9d4e03dc2
|
||||||
content/39: cf10560ae6defb8ee5da344fc6509f6e
|
content/39: 7bb928aba33a4013ad5f08487da5bbf9
|
||||||
content/40: 1dea5c6442c127ae290185db0cef067b
|
content/40: dbbf313837f13ddfa4a8843d71cb9cc4
|
||||||
content/41: 332dab0588fb35dabb64b674ba6120eb
|
content/41: cf10560ae6defb8ee5da344fc6509f6e
|
||||||
content/42: 714b3f99b0a8686bbb3434deb1f682b3
|
content/42: 1dea5c6442c127ae290185db0cef067b
|
||||||
content/43: ba18ac99184b17d7e49bd1abdc814437
|
content/43: 332dab0588fb35dabb64b674ba6120eb
|
||||||
content/44: bed2b629274d55c38bd637e6a28dbc4a
|
content/44: 714b3f99b0a8686bbb3434deb1f682b3
|
||||||
content/45: 71487ae6f6fb1034d1787456de442e6d
|
content/45: ba18ac99184b17d7e49bd1abdc814437
|
||||||
content/46: 137d9874cf5ec8d09bd447f224cc7a7c
|
content/46: bed2b629274d55c38bd637e6a28dbc4a
|
||||||
content/47: 6b5b4c3b2f98b8fc7dd908fef2605ce8
|
content/47: 71487ae6f6fb1034d1787456de442e6d
|
||||||
content/48: 3af6812662546ce647a55939241fd88e
|
content/48: 137d9874cf5ec8d09bd447f224cc7a7c
|
||||||
content/49: 6a4d7f0ccb8c28303251d1ef7b3dcca7
|
content/49: 6b5b4c3b2f98b8fc7dd908fef2605ce8
|
||||||
content/50: 5dce779f77cc2b0abf12802a833df499
|
content/50: 3af6812662546ce647a55939241fd88e
|
||||||
content/51: aa47ff01b631252f024eaaae0c773e42
|
content/51: 6a4d7f0ccb8c28303251d1ef7b3dcca7
|
||||||
content/52: 1266d1c7582bb617cdef56857be34f30
|
content/52: 5dce779f77cc2b0abf12802a833df499
|
||||||
content/53: c2cef2688104adaf6641092f43d4969a
|
content/53: aa47ff01b631252f024eaaae0c773e42
|
||||||
content/54: 089fc64b4589b2eaa371de7e04c4aed9
|
content/54: 1266d1c7582bb617cdef56857be34f30
|
||||||
|
content/55: c2cef2688104adaf6641092f43d4969a
|
||||||
|
content/56: 089fc64b4589b2eaa371de7e04c4aed9
|
||||||
722959335ba76c9d0097860e2ad5a952:
|
722959335ba76c9d0097860e2ad5a952:
|
||||||
meta/title: 1f5b53b9904ec41d49c1e726e3d56b40
|
meta/title: 1f5b53b9904ec41d49c1e726e3d56b40
|
||||||
content/0: c2b41859d63a751682f0d9aec488e581
|
content/0: c2b41859d63a751682f0d9aec488e581
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { type NextRequest, NextResponse } from 'next/server'
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { getBYOKKey } from '@/lib/api-key/byok'
|
|
||||||
import { checkHybridAuth } from '@/lib/auth/hybrid'
|
import { checkHybridAuth } from '@/lib/auth/hybrid'
|
||||||
import { SEARCH_TOOL_COST } from '@/lib/billing/constants'
|
import { SEARCH_TOOL_COST } from '@/lib/billing/constants'
|
||||||
import { env } from '@/lib/core/config/env'
|
import { env } from '@/lib/core/config/env'
|
||||||
@@ -11,7 +10,6 @@ const logger = createLogger('search')
|
|||||||
|
|
||||||
const SearchRequestSchema = z.object({
|
const SearchRequestSchema = z.object({
|
||||||
query: z.string().min(1),
|
query: z.string().min(1),
|
||||||
workspaceId: z.string().optional(),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
export const maxDuration = 60
|
export const maxDuration = 60
|
||||||
@@ -41,17 +39,7 @@ export async function POST(request: NextRequest) {
|
|||||||
const body = await request.json()
|
const body = await request.json()
|
||||||
const validated = SearchRequestSchema.parse(body)
|
const validated = SearchRequestSchema.parse(body)
|
||||||
|
|
||||||
let exaApiKey = env.EXA_API_KEY
|
const exaApiKey = env.EXA_API_KEY
|
||||||
let isBYOK = false
|
|
||||||
|
|
||||||
if (validated.workspaceId) {
|
|
||||||
const byokResult = await getBYOKKey(validated.workspaceId, 'exa')
|
|
||||||
if (byokResult) {
|
|
||||||
exaApiKey = byokResult.apiKey
|
|
||||||
isBYOK = true
|
|
||||||
logger.info(`[${requestId}] Using workspace BYOK key for Exa search`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!exaApiKey) {
|
if (!exaApiKey) {
|
||||||
logger.error(`[${requestId}] No Exa API key available`)
|
logger.error(`[${requestId}] No Exa API key available`)
|
||||||
@@ -64,7 +52,6 @@ export async function POST(request: NextRequest) {
|
|||||||
logger.info(`[${requestId}] Executing search`, {
|
logger.info(`[${requestId}] Executing search`, {
|
||||||
userId,
|
userId,
|
||||||
query: validated.query,
|
query: validated.query,
|
||||||
isBYOK,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const result = await executeTool('exa_search', {
|
const result = await executeTool('exa_search', {
|
||||||
@@ -100,7 +87,7 @@ export async function POST(request: NextRequest) {
|
|||||||
const cost = {
|
const cost = {
|
||||||
input: 0,
|
input: 0,
|
||||||
output: 0,
|
output: 0,
|
||||||
total: isBYOK ? 0 : SEARCH_TOOL_COST,
|
total: SEARCH_TOOL_COST,
|
||||||
tokens: {
|
tokens: {
|
||||||
input: 0,
|
input: 0,
|
||||||
output: 0,
|
output: 0,
|
||||||
@@ -119,7 +106,6 @@ export async function POST(request: NextRequest) {
|
|||||||
userId,
|
userId,
|
||||||
resultCount: results.length,
|
resultCount: results.length,
|
||||||
cost: cost.total,
|
cost: cost.total,
|
||||||
isBYOK,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { getUserEntityPermissions } from '@/lib/workspaces/permissions/utils'
|
|||||||
|
|
||||||
const logger = createLogger('WorkspaceBYOKKeysAPI')
|
const logger = createLogger('WorkspaceBYOKKeysAPI')
|
||||||
|
|
||||||
const VALID_PROVIDERS = ['openai', 'anthropic', 'google', 'mistral', 'exa'] as const
|
const VALID_PROVIDERS = ['openai', 'anthropic', 'google', 'mistral'] as const
|
||||||
|
|
||||||
const UpsertKeySchema = z.object({
|
const UpsertKeySchema = z.object({
|
||||||
providerId: z.enum(VALID_PROVIDERS),
|
providerId: z.enum(VALID_PROVIDERS),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { Component, type ReactNode, useEffect } from 'react'
|
import { Component, type ReactNode, useEffect } from 'react'
|
||||||
|
import { ReactFlowProvider } from 'reactflow'
|
||||||
import { createLogger } from '@/lib/logs/console/logger'
|
import { createLogger } from '@/lib/logs/console/logger'
|
||||||
import { Panel } from '@/app/workspace/[workspaceId]/w/[workflowId]/components'
|
import { Panel } from '@/app/workspace/[workspaceId]/w/[workflowId]/components'
|
||||||
import { Sidebar } from '@/app/workspace/[workspaceId]/w/components/sidebar/sidebar'
|
import { Sidebar } from '@/app/workspace/[workspaceId]/w/components/sidebar/sidebar'
|
||||||
@@ -47,8 +48,9 @@ export function ErrorUI({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Panel */}
|
<ReactFlowProvider>
|
||||||
<Panel />
|
<Panel />
|
||||||
|
</ReactFlowProvider>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,9 +9,11 @@ export type { AutoLayoutOptions }
|
|||||||
const logger = createLogger('useAutoLayout')
|
const logger = createLogger('useAutoLayout')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook providing auto-layout functionality for workflows
|
* Hook providing auto-layout functionality for workflows.
|
||||||
* Binds workflowId context and provides memoized callback for React components
|
* Binds workflowId context and provides memoized callback for React components.
|
||||||
* Includes automatic fitView animation after successful layout
|
* Includes automatic fitView animation after successful layout.
|
||||||
|
*
|
||||||
|
* Note: This hook requires a ReactFlowProvider ancestor.
|
||||||
*/
|
*/
|
||||||
export function useAutoLayout(workflowId: string | null) {
|
export function useAutoLayout(workflowId: string | null) {
|
||||||
const { fitView } = useReactFlow()
|
const { fitView } = useReactFlow()
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ import {
|
|||||||
ModalContent,
|
ModalContent,
|
||||||
ModalFooter,
|
ModalFooter,
|
||||||
ModalHeader,
|
ModalHeader,
|
||||||
Trash,
|
|
||||||
} from '@/components/emcn'
|
} from '@/components/emcn'
|
||||||
import { AnthropicIcon, ExaAIIcon, GeminiIcon, MistralIcon, OpenAIIcon } from '@/components/icons'
|
import { AnthropicIcon, GeminiIcon, MistralIcon, OpenAIIcon } from '@/components/icons'
|
||||||
import { Skeleton } from '@/components/ui'
|
import { Skeleton } from '@/components/ui'
|
||||||
import { createLogger } from '@/lib/logs/console/logger'
|
import { createLogger } from '@/lib/logs/console/logger'
|
||||||
import {
|
import {
|
||||||
@@ -61,26 +60,19 @@ const PROVIDERS: {
|
|||||||
description: 'LLM calls and Knowledge Base OCR',
|
description: 'LLM calls and Knowledge Base OCR',
|
||||||
placeholder: 'Enter your API key',
|
placeholder: 'Enter your API key',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 'exa',
|
|
||||||
name: 'Exa',
|
|
||||||
icon: ExaAIIcon,
|
|
||||||
description: 'Web Search block',
|
|
||||||
placeholder: 'Enter your API key',
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
function BYOKKeySkeleton() {
|
function BYOKKeySkeleton() {
|
||||||
return (
|
return (
|
||||||
<div className='flex items-center justify-between gap-[12px] rounded-[8px] border p-[12px]'>
|
<div className='flex items-center justify-between gap-[12px]'>
|
||||||
<div className='flex items-center gap-[12px]'>
|
<div className='flex items-center gap-[12px]'>
|
||||||
<Skeleton className='h-[32px] w-[32px] rounded-[6px]' />
|
<Skeleton className='h-9 w-9 flex-shrink-0 rounded-[6px]' />
|
||||||
<div className='flex flex-col gap-[4px]'>
|
<div className='flex min-w-0 flex-col justify-center gap-[1px]'>
|
||||||
<Skeleton className='h-[16px] w-[80px]' />
|
<Skeleton className='h-[14px] w-[100px]' />
|
||||||
<Skeleton className='h-[14px] w-[160px]' />
|
<Skeleton className='h-[13px] w-[200px]' />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Skeleton className='h-[32px] w-[80px] rounded-[6px]' />
|
<Skeleton className='h-[32px] w-[72px] rounded-[6px]' />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -166,41 +158,40 @@ export function BYOK() {
|
|||||||
const Icon = provider.icon
|
const Icon = provider.icon
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div key={provider.id} className='flex items-center justify-between gap-[12px]'>
|
||||||
key={provider.id}
|
|
||||||
className='flex items-center justify-between gap-[12px] rounded-[8px] border p-[12px]'
|
|
||||||
>
|
|
||||||
<div className='flex items-center gap-[12px]'>
|
<div className='flex items-center gap-[12px]'>
|
||||||
<div className='flex h-[32px] w-[32px] items-center justify-center rounded-[6px] bg-[var(--surface-3)]'>
|
<div className='flex h-9 w-9 flex-shrink-0 items-center justify-center overflow-hidden rounded-[6px] bg-[var(--surface-6)]'>
|
||||||
<Icon className='h-[18px] w-[18px]' />
|
<Icon className='h-4 w-4' />
|
||||||
</div>
|
</div>
|
||||||
<div className='flex flex-col gap-[2px]'>
|
<div className='flex min-w-0 flex-col justify-center gap-[1px]'>
|
||||||
<span className='font-medium text-[14px]'>{provider.name}</span>
|
<span className='font-medium text-[14px]'>{provider.name}</span>
|
||||||
<span className='text-[12px] text-[var(--text-tertiary)]'>
|
<p className='truncate text-[13px] text-[var(--text-muted)]'>
|
||||||
{provider.description}
|
{existingKey ? existingKey.maskedKey : provider.description}
|
||||||
</span>
|
</p>
|
||||||
{existingKey && (
|
|
||||||
<span className='font-mono text-[11px] text-[var(--text-muted)]'>
|
|
||||||
{existingKey.maskedKey}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='flex items-center gap-[6px]'>
|
{existingKey ? (
|
||||||
{existingKey && (
|
<div className='flex flex-shrink-0 items-center gap-[8px]'>
|
||||||
|
<Button variant='ghost' onClick={() => openEditModal(provider.id)}>
|
||||||
|
Update
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
className='h-9 w-9'
|
|
||||||
onClick={() => setDeleteConfirmProvider(provider.id)}
|
onClick={() => setDeleteConfirmProvider(provider.id)}
|
||||||
>
|
>
|
||||||
<Trash />
|
Delete
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<Button variant='default' onClick={() => openEditModal(provider.id)}>
|
|
||||||
{existingKey ? 'Update' : 'Add Key'}
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
variant='primary'
|
||||||
|
className='!bg-[var(--brand-tertiary-2)] !text-[var(--text-inverse)] hover:!bg-[var(--brand-tertiary-2)]/90'
|
||||||
|
onClick={() => openEditModal(provider.id)}
|
||||||
|
>
|
||||||
|
Add Key
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
@@ -235,7 +226,24 @@ export function BYOK() {
|
|||||||
requests in this workspace. Your key is encrypted and stored securely.
|
requests in this workspace. Your key is encrypted and stored securely.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className='mt-[12px] flex flex-col gap-[8px]'>
|
<div className='mt-[16px] flex flex-col gap-[8px]'>
|
||||||
|
<p className='font-medium text-[13px] text-[var(--text-secondary)]'>
|
||||||
|
Enter your API key
|
||||||
|
</p>
|
||||||
|
{/* Hidden decoy fields to prevent browser autofill */}
|
||||||
|
<input
|
||||||
|
type='text'
|
||||||
|
name='fakeusernameremembered'
|
||||||
|
autoComplete='username'
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
left: '-9999px',
|
||||||
|
opacity: 0,
|
||||||
|
pointerEvents: 'none',
|
||||||
|
}}
|
||||||
|
tabIndex={-1}
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
<div className='relative'>
|
<div className='relative'>
|
||||||
<EmcnInput
|
<EmcnInput
|
||||||
type={showApiKey ? 'text' : 'password'}
|
type={showApiKey ? 'text' : 'password'}
|
||||||
@@ -247,6 +255,12 @@ export function BYOK() {
|
|||||||
placeholder={PROVIDERS.find((p) => p.id === editingProvider)?.placeholder}
|
placeholder={PROVIDERS.find((p) => p.id === editingProvider)?.placeholder}
|
||||||
className='h-9 pr-[36px]'
|
className='h-9 pr-[36px]'
|
||||||
autoFocus
|
autoFocus
|
||||||
|
name='byok_api_key'
|
||||||
|
autoComplete='off'
|
||||||
|
autoCorrect='off'
|
||||||
|
autoCapitalize='off'
|
||||||
|
data-lpignore='true'
|
||||||
|
data-form-type='other'
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
@@ -282,6 +296,7 @@ export function BYOK() {
|
|||||||
variant='primary'
|
variant='primary'
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={!apiKeyInput.trim() || upsertKey.isPending}
|
disabled={!apiKeyInput.trim() || upsertKey.isPending}
|
||||||
|
className='!bg-[var(--brand-tertiary-2)] !text-[var(--text-inverse)] hover:!bg-[var(--brand-tertiary-2)]/90'
|
||||||
>
|
>
|
||||||
{upsertKey.isPending ? 'Saving...' : 'Save'}
|
{upsertKey.isPending ? 'Saving...' : 'Save'}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -305,7 +320,12 @@ export function BYOK() {
|
|||||||
<Button variant='default' onClick={() => setDeleteConfirmProvider(null)}>
|
<Button variant='default' onClick={() => setDeleteConfirmProvider(null)}>
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant='primary' onClick={handleDelete} disabled={deleteKey.isPending}>
|
<Button
|
||||||
|
variant='primary'
|
||||||
|
onClick={handleDelete}
|
||||||
|
disabled={deleteKey.isPending}
|
||||||
|
className='!bg-[var(--brand-tertiary-2)] !text-[var(--text-inverse)] hover:!bg-[var(--brand-tertiary-2)]/90'
|
||||||
|
>
|
||||||
{deleteKey.isPending ? 'Deleting...' : 'Delete'}
|
{deleteKey.isPending ? 'Deleting...' : 'Delete'}
|
||||||
</Button>
|
</Button>
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useParams, useRouter } from 'next/navigation'
|
import { useParams, useRouter } from 'next/navigation'
|
||||||
|
import { ReactFlowProvider } from 'reactflow'
|
||||||
import { createLogger } from '@/lib/logs/console/logger'
|
import { createLogger } from '@/lib/logs/console/logger'
|
||||||
import { Panel, Terminal } from '@/app/workspace/[workspaceId]/w/[workflowId]/components'
|
import { Panel, Terminal } from '@/app/workspace/[workspaceId]/w/[workflowId]/components'
|
||||||
import { useWorkflows } from '@/hooks/queries/workflows'
|
import { useWorkflows } from '@/hooks/queries/workflows'
|
||||||
@@ -69,7 +70,9 @@ export default function WorkflowsPage() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<ReactFlowProvider>
|
||||||
<Panel />
|
<Panel />
|
||||||
|
</ReactFlowProvider>
|
||||||
</div>
|
</div>
|
||||||
<Terminal />
|
<Terminal />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { API_ENDPOINTS } from '@/stores/constants'
|
|||||||
|
|
||||||
const logger = createLogger('BYOKKeysQueries')
|
const logger = createLogger('BYOKKeysQueries')
|
||||||
|
|
||||||
export type BYOKProviderId = 'openai' | 'anthropic' | 'google' | 'mistral' | 'exa'
|
export type BYOKProviderId = 'openai' | 'anthropic' | 'google' | 'mistral'
|
||||||
|
|
||||||
export interface BYOKKey {
|
export interface BYOKKey {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { createLogger } from '@/lib/logs/console/logger'
|
|||||||
|
|
||||||
const logger = createLogger('BYOKKeys')
|
const logger = createLogger('BYOKKeys')
|
||||||
|
|
||||||
export type BYOKProviderId = 'openai' | 'anthropic' | 'google' | 'mistral' | 'exa'
|
export type BYOKProviderId = 'openai' | 'anthropic' | 'google' | 'mistral'
|
||||||
|
|
||||||
export interface BYOKKeyResult {
|
export interface BYOKKeyResult {
|
||||||
apiKey: string
|
apiKey: string
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export const searchTool: ToolConfig<SearchParams, SearchResponse> = {
|
|||||||
}),
|
}),
|
||||||
body: (params) => ({
|
body: (params) => ({
|
||||||
query: params.query,
|
query: params.query,
|
||||||
workspaceId: params._context?.workspaceId,
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,6 @@ import type { ToolResponse } from '@/tools/types'
|
|||||||
|
|
||||||
export interface SearchParams {
|
export interface SearchParams {
|
||||||
query: string
|
query: string
|
||||||
_context?: {
|
|
||||||
workflowId?: string
|
|
||||||
workspaceId?: string
|
|
||||||
executionId?: string
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SearchResponse extends ToolResponse {
|
export interface SearchResponse extends ToolResponse {
|
||||||
|
|||||||
Reference in New Issue
Block a user