Skip to main content

meteor-ia — SDK oficial de Python para Meteor

Infraestructura agéntica como servicio. Ejecutá tus Mets, gestioná el CRM, integraciones MCP y más, por código.

Server-side only: tu API key met_* es secreta. Nunca la expongas en el browser.

Instalación

pip install meteor-ia

Sin dependencias de runtime (solo la stdlib).

Antes de anunciar una versión

Después de publicar, verificá el artefacto desde PyPI —no el código del workspace— antes de anunciarlo:

npm run python-sdk:published-check

El chequeo instala exactamente la versión declarada en un directorio temporal y comprueba que importa, que su versión coincide y que expone la superficie mínima del cliente. Si PyPI todavía sirve una versión anterior, falla de forma explícita.

Uso

import os
from meteor_ia import Met

met = Met(os.environ["MET_API_KEY"], workspace_id=7)

# Ejecutar un Met y esperar el resultado
run = met.runs.create("Resume los leads de hoy", met="ventas")
print(run["output"])
print(run["energy"])  # breakdown de Energía del run

# Streaming de eventos
for event, data in met.runs.stream("Hola"):
    print(event, data)

# CRM
for contact in met.contacts.iterate():
    print(contact["id"], contact.get("name"))

Manejo de errores

from meteor_ia import MetRateLimitError, MetAuthError

try:
    met.runs.create("...")
except MetRateLimitError as e:
    if e.is_quota:
        # Cupo agotado: no se resuelve reintentando. Frena el lote hasta el reinicio.
        print(e.code, e.message, "se reinicia en", e.retry_after, "segundos")
    else:
        print("límite por minuto: espera", e.retry_after, "segundos")
except MetAuthError:
    print("key inválida")

Jerarquía: MetError → MetAuthError (401), MetInvalidRequestError (400/403/404/409), MetRateLimitError (429, con retry_after e is_quota), MetAgentError (el Met falló), MetApiError (5xx).

Qué 429 reintenta el SDK

code Qué es ¿El SDK reintenta?
rate_limited Límite de peticiones por minuto Sí, hasta max_retries veces, respetando Retry-After
daily_request_limit_exceeded Tope diario de peticiones del workspace No: lanza de una (Retry-After = segundos hasta las 00:00 UTC)
quota_exceeded Cuota mensual de la API key No
test_run_daily_cap Tope diario de runs con key de prueba No
budget_exceeded Presupuesto de Energía del mes de la key No

Un cupo agotado no se arregla esperando unos segundos, así que el SDK no gasta tu tiempo reintentándolo: te entrega el MetRateLimitError con code, message, retry_after e is_quota=True. Tampoco reintenta un 429 cuyo Retry-After pase de 60 segundos. La lista está en QUOTA_ERROR_CODES y la puedes consultar con is_quota_error_code(code).

Mirar el cupo antes de chocarte con él

met.billing.limits() (scope billing:read) trae todos los límites del plan en una llamada: por cada recurso, lo usado, lo incluido, lo que suman tus complementos, el tope que se aplica hoy (limit), qué pasa al llegar (enforcement: hard bloquea, soft avisa y frena a 3 veces el tope, none solo mide) y cuándo se reinicia (resets_at, 00:00 UTC). La respuesta está tipada como PlanLimits.

limites = met.billing.limits()
api = next(r for r in limites["resources"] if r["key"] == "api_requests_daily")
if api["limit"] is not None and api["used"] + len(lote) > api["limit"]:
    print("No alcanza: te quedan", api["limit"] - api["used"], "hasta", api["resets_at"])

Webhooks salientes (Meteor → tu servidor)

Verificá la firma HMAC de cada entrega antes de procesarla:

from meteor_ia import construct_event, MetSignatureVerificationError

# En tu handler HTTP (Flask/FastAPI/…):
try:
    event = construct_event(raw_body, signature_header, os.environ["MET_WEBHOOK_SECRET"])
except MetSignatureVerificationError:
    return ("bad signature", 400)

if event["type"] == "run.completed":
    ...

Partners

Con una key de partner (partner:*):

met.partner.clients.list()
met.partner.commissions.list(status="PAID")
met.partner.payouts.summary()

Auto-paginación

Los endpoints de lista devuelven { "data": [...], "has_more": bool }. Usá .iterate() para recorrer todo transparentemente (cursor opaco starting_after).

Reintentos

429 y 5xx se reintentan con backoff exponencial (default 2 intentos, respeta Retry-After). Los POST llevan Idempotency-Key automático para no duplicar.

Metadata

Release files for meteor-ia 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meteor-ia 0.4.2
File Size Uploaded Provenance Actions
meteor_ia-0.4.2.tar.gz 53.0 kB Without provenance Details for meteor_ia-0.4.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for meteor-ia 0.4.2
File Interpreter ABI Platform Actions
meteor_ia-0.4.2-py3-none-any.whl Python 3 none any Details for meteor_ia-0.4.2-py3-none-any.whl

Total release size: 94.9 kB

Release files / meteor_ia-0.4.2.tar.gz

Download URL meteor_ia-0.4.2.tar.gz
Size 53.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4eb818c7af71d940bbbe3899b045d0cebd7363f08d1dfeec8cf9225be7a3327b
BLAKE2b-256 checksum
How to use checksums
4f2721427fe4151693d6fab60da9e9dc302f700489b44d28cce748765ad45762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / meteor_ia-0.4.2-py3-none-any.whl

Download URL meteor_ia-0.4.2-py3-none-any.whl
Size 42.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
459b8c8ae78d0a7303bf21af691727796d95ab672dc5e96dd38126cb84cc459e
BLAKE2b-256 checksum
How to use checksums
3ea0f38b2604ea8e39c9bf201a6aeff461c73e974095fa7bc9a1ff6f4cf4bd3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for meteor-ia 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page