> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiandgpu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Start using AGCloud API in under 5 minutes

export const ClaudeChat = ({model = "claude-haiku-4-5-20251001"}) => {
  const curlExample = `curl --request POST \\
  --url https://aiandgpu.com/v1/messages \\
  --header 'Authorization: Bearer <YOUR_API_KEY>' \\
  --header 'Content-Type: application/json' \\
  --data '{
    "model": "${model}",
    "max_tokens": 1024,
    "messages": [
        {
            "role": "user",
            "content": [{"type": "text", "text": "Hello"}]
        }
    ]
}'`;
  const pythonExample = `import requests

url = "https://aiandgpu.com/v1/messages"

payload = {
    "model": "${model}",
    "max_tokens": 1024,
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Hello"
                }
            ]
        }
    ]
}

headers = {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)`;
  const jsExample = `const options = {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <YOUR_API_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: '${model}',
    max_tokens: 1024,
    messages: [{role: 'user', content: [{type: 'text', text: 'Hello'}]}]
  })
};

fetch('https://aiandgpu.com/v1/messages', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));`;
  const goExample = `package main

import (
\t"bytes"
\t"encoding/json"
\t"fmt"
\t"net/http"
\t"io"
)

func main() {
\turl := "https://aiandgpu.com/v1/messages"

\tpayload := strings.NewReader("{\\"model\\": \\"claude-haiku-4-5-20251001\\", \\"max_tokens\\": 1024, \\"messages\\": [{\\"role\\": \\"user\\", \\"content\\": [{ \\"type\\": \\"text\\", \\"text\\": \\"who are you?\\"}]}]}")

\treq, _ := http.NewRequest("POST", url, payload)

\treq.Header.Add("Authorization", "Bearer <YOUR_API_KEY>")
\treq.Header.Add("Content-Type", "application/json")

\tres, _ := http.DefaultClient.Do(req)

\tdefer res.Body.Close()
\tresBody, _ := io.ReadAll(res.Body)

\tfmt.Println(string(resBody))
}`;
  const javaExample = `import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();

String body = """
{
  "model": "${model}",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": [{"type": "text", "text": "Hello"}]
    }
  ]
}
""";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://aiandgpu.com/v1/messages"))
    .header("Authorization", "Bearer <YOUR_API_KEY>")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(body))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());`;
  const phpExample = `<?php

$curl = curl_init();

$payload = json_encode([
    'model' => '${model}',
    'max_tokens' => 1024,
    'messages' => [
        [
            'role' => 'user',
            'content' => [
                ['type' => 'text', 'text' => 'Hello']
            ]
        ]
    ]
]);

curl_setopt_array($curl, [
    CURLOPT_URL => "https://aiandgpu.com/v1/messages",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => $payload,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer <YOUR_API_KEY>",
        "Content-Type: application/json"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}`;
  const csharpExample = `using System.Net.Http;
using System.Text;

var client = new HttpClient();

var payload = @"{
    ""model"": ""${model}"",
    ""max_tokens"": 1024,
    ""messages"": [
        {
            ""role"": ""user"",
            ""content"": [{""type"": ""text"", ""text"": ""Hello""}]
        }
    ]
}";

var request = new HttpRequestMessage(HttpMethod.Post, "https://aiandgpu.com/v1/messages");
request.Headers.Add("Authorization", "Bearer <YOUR_API_KEY>");
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");

var response = await client.SendAsync(request);
var content = await response.Content.ReadAsStringAsync();

Console.WriteLine(content);`;
  return <>
      <h2>Request Examples</h2>

      <CodeGroup>
        <CodeBlock language="shellscript" filename="cURL">
          {curlExample}
        </CodeBlock>
        <CodeBlock language="python" filename="Python">
          {pythonExample}
        </CodeBlock>
        <CodeBlock language="javascript" filename="JavaScript">
          {jsExample}
        </CodeBlock>
        <CodeBlock language="go" filename="Go">
          {goExample}
        </CodeBlock>
        <CodeBlock language="java" filename="Java">
          {javaExample}
        </CodeBlock>
        <CodeBlock language="php" filename="PHP">
          {phpExample}
        </CodeBlock>
        <CodeBlock language="csharp" filename="C#">
          {csharpExample}
        </CodeBlock>
      </CodeGroup>
    </>;
};

## Get Your API Key First

First, sign up for an account and get your API key from the [**AGCloud Dashboard**](https://developer.aiandgpu.com/signup).

<Danger>
  Do not show your API Key to anybody! Otherwise your account will be at risk.
</Danger>

## Make Your First Request

Here’s how to make your first API call using different programming languages:

<ClaudeChat />

## Response Format

You’ll receive a JSON response like:

```json theme={null}
{
    "model": "claude-haiku-4-5-20251001",
    "id": "msg_bdrk_01LZo848oHddNScrKvWF5F2w",
    "type": "message",
    "role": "assistant",
    "content": [
        {
            "type": "text",
            "text": "你好！😊\n有什么我可以帮助你的吗？"
        }
    ],
    "stop_reason": "end_turn",
    "stop_sequence": null,
    "usage": {
        "input_tokens": 16,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "cache_creation": {
            "ephemeral_5m_input_tokens": 0,
            "ephemeral_1h_input_tokens": 0
        },
        "output_tokens": 102
    }
}
```

## Next Step

<CardGroup cols={2}>
  <Card color="#1a2ac4" icon="microchip-ai" title="Explore Claude APIs">
    Learn about  claude-haiku-4-5-20251001 and other Authropic AI models
  </Card>

  <Card color="#1a2ac4" icon="input-text" title="Try Text Generation">
    Create text using claude-haiku-4-5-20251001
  </Card>

  <Card color="#1a2ac4" icon="video-plus" title="Generate Videos">
    Create intersting videos with Sora
  </Card>

  <Card color="#1a2ac4" icon="user-robot" title="Use Claude API">
    Access Authropic Claude's advanced capablities
  </Card>
</CardGroup>

## Common Use Cases

### **Chat Completion**

Build conversational AI applications with context-aware responses.

### **Image Generation**

Create unique images from text descriptions for marketing, design, or creative projects.

### **Video Synthesis**

Generate video content for social media, advertising, or educational purposes.

### **Audio Processing**

Transcribe audio files or convert text to natural-sounding speech.

## **Rate Limits & Pricing**

<Note>
  Rate limits and pricing vary by model and subscription tier. Check your [**Dashboard**](https://developer.aiandgpu.com) for details specific to your account.
</Note>

## Need Help?

* Check out our [**API Reference**](https://docs.aiandgpu.com/api-reference) for detailed endpoint documentation
* Visit our  **API document** to find resolution
* Contact \[[info@thousandcloud.com](mailto:info@thousandcloud.com)] for assistance
