AI Services

Generate AI text with failover

Generate long-form or transactional text with automatic failover across Groq, GLM, DeepSeek, and Gemini models.

For AI agents: Use this endpoint for content generation tasks like blog posts, customer emails, sales copy, or conversational replies.

post/ai/generate-text

Request

  • Base URL: https://us-central1-paymentgateway-ab783.cloudfunctions.net/api
  • URL: https://us-central1-paymentgateway-ab783.cloudfunctions.net/api/ai/generate-text
  • Auth: HTTP bearer

Headers

x-app-idstring required

Application identifier used for per-app rate limiting and usage tracking.

Request body

promptstring required

Natural language instruction or content request.

maxTokensinteger

Maximum tokens to generate (1-8000).

temperaturenumber

Creativity level from 0 (deterministic) to 2 (creative).

timeoutinteger

Timeout in milliseconds before failover triggers.

Example request

{
  "prompt": "Write a 300 word blog post about AI trends in 2025."
}

Response

Text generated successfully

contentstring

Generated text output.

providerstring

Upstream AI provider that produced the response.

modelstring
durationnumber

Processing time in milliseconds.

Example response

{
  "provider": "groq",
  "model": "openai/gpt-oss-120b",
  "duration": 2500
}

Changes

No recorded changes to this operation across all 1 revision of this API.