File size: 921 Bytes
9304c05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import requests

# Get the API key
api_key = os.environ.get("key", "")
print(f"1. API Key loaded: {'Yes' if api_key else 'No'}")
print(f"2. Key length: {len(api_key)}")
print(f"3. First 4 chars: {api_key[:4] if api_key else 'None'}")

# Try a simple request
url = "https://ark.ap-southeast.bytepluses.com/api/v3/contents/generations/tasks"
headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {api_key}"
}

# Minimal test data
data = {
    "model": "seedance-1-5-pro-251215",
    "content": [
        {
            "type": "text",
            "text": "test"
        }
    ]
}

print("\n4. Sending test request...")
try:
    response = requests.post(url, headers=headers, json=data)
    print(f"5. Status code: {response.status_code}")
    print(f"6. Response: {response.text[:200]}")  # First 200 chars
except Exception as e:
    print(f"5. Error: {e}")

print("\n7. Test complete")