Documentation

Complete guides, tutorials, and API documentation for YilziCode services.

Getting Started

1. Installation

To get started with YilziCode AI services, first ensure you have Node.js 16.0 or higher installed on your system.

npm install yilzicode-ai --save yarn add yilzicode-ai

2. Authentication

All YilziCode API requests require authentication using your API key. You can obtain your API key from your dashboard at yilzicode.com/dashboard

import YilziCode from 'yilzicode-ai';

const client = new YilziCode({
  apiKey: process.env.YILZICODE_API_KEY,
});

3. Basic Usage

Here's a simple example to get you started:

const response = await client.generate({
  model: 'yilzi-gpt-4',
  prompt: 'Explain machine learning',
  max_tokens: 500
});

console.log(response.text);

API Reference

Generate Text

Generate text using AI models

Endpoint: POST /api/generate

Authentication: Required (API Key)

Rate Limit: 100 requests per minute

Analyze Content

Analyze and process content with AI

Endpoint: POST /api/analyze

Authentication: Required (API Key)

Rate Limit: 50 requests per minute

Batch Processing

Process multiple items in batch

Endpoint: POST /api/batch

Authentication: Required (API Key)

Rate Limit: 10 requests per minute

Advanced Features

Custom Models

YilziCode allows you to fine-tune models for specific use cases. Contact support for more information.

Webhooks

Set up webhooks to receive real-time notifications about your API calls and batch processing jobs.

Streaming Responses

Use streaming for real-time responses on long-running tasks with Server-Sent Events (SSE).

Best Practices

  • Always use environment variables for API keys, never hardcode them
  • Implement proper error handling and retry logic with exponential backoff
  • Cache responses when possible to reduce API calls and costs
  • Monitor your API usage through the dashboard
  • Test your implementation in sandbox mode before production

Support

Need help? Contact our support team through WhatsApp, Telegram, or email. For API-specific issues, check the error codes documentation or reach out to our technical support team.