vendor_fabric.meshy.base

Base HTTP client - auth, retries, rate limiting.

This module handles ALL the HTTP infrastructure. API modules import this.

Uses InputProvider for credential loading, consistent with other vendor-fabric integrations. Credentials can come from:

  • Environment variables (MESHY_API_KEY)

  • Direct parameters

  • stdin JSON input

Module Contents

Functions

configure

Configure Meshy API credentials.

get_api_key

Get API key from InputProvider (env vars, direct inputs, or stdin).

get_client

Get or create HTTP client.

close

Close the HTTP client.

task_failure_message

Return a public, redacted Meshy task failure message.

unexpected_response_message

Return a public, redacted unexpected-response diagnostic.

task_id_from_response

Extract a non-empty Meshy task id from a create/refine response.

task_payload_from_response

Validate a Meshy task payload and return a promoted public mapping.

request

Make HTTP request with retries and rate limiting.

download

Download file from URL.

Data

API

exception vendor_fabric.meshy.base.RateLimitError

Bases: Exception

Raised when API rate limit is hit.

Initialization

Initialize self. See help(type(self)) for accurate signature.

add_note()
class args
with_traceback()
exception vendor_fabric.meshy.base.MeshyAPIError(message: str, status_code: int | None = None)

Bases: Exception

Raised when API returns an error.

Initialization

Initialize self. See help(type(self)) for accurate signature.

add_note()
class args
with_traceback()
vendor_fabric.meshy.base.BASE_URL = 'https://api.meshy.ai'
vendor_fabric.meshy.base.configure(api_key: str | None = None, **kwargs: Any) None

Configure Meshy API credentials.

Args: api_key: Meshy API key (overrides environment variable) **kwargs: Additional inputs to merge

vendor_fabric.meshy.base.get_api_key() str

Get API key from InputProvider (env vars, direct inputs, or stdin).

vendor_fabric.meshy.base.get_client() httpx.Client

Get or create HTTP client.

vendor_fabric.meshy.base.close() None

Close the HTTP client.

vendor_fabric.meshy.base.task_failure_message(error: Any) str

Return a public, redacted Meshy task failure message.

vendor_fabric.meshy.base.unexpected_response_message(data: Any) str

Return a public, redacted unexpected-response diagnostic.

vendor_fabric.meshy.base.task_id_from_response(response: httpx.Response) extended_data.containers.ExtendedString

Extract a non-empty Meshy task id from a create/refine response.

vendor_fabric.meshy.base.task_payload_from_response(response: httpx.Response, model_type: type[pydantic.BaseModel], endpoint: str) extended_data.containers.ExtendedDict

Validate a Meshy task payload and return a promoted public mapping.

vendor_fabric.meshy.base.request(method: str, endpoint: str, *, version: str = 'v2', **kwargs: Any) httpx.Response

Make HTTP request with retries and rate limiting.

Args: method: HTTP method (GET, POST, etc.) endpoint: API endpoint (e.g., “text-to-3d”) version: API version (v1 or v2) **kwargs: Passed to httpx.request (json, params, etc.)

Returns: httpx.Response

Raises: RateLimitError: On 429 (will retry) MeshyAPIError: On other API errors

vendor_fabric.meshy.base.download(url: str, output_path: str) int

Download file from URL.

Args: url: URL to download from output_path: Local path to save to

Returns: File size in bytes